ELF now recognises zstd in addition to zlib (which we've used for years w/ FEATURES=compressdebug) for debug info compression. Right now, in bin/estrip, we pass `--compress-debug-sections` to objcopy. For zstd support, we need to do `--compress-debug-sections=zstd`. It should be easy to make this configurable, we just need to bikeshed on the naming/method/variable name/whatever. I've written up general usage instructions on the wiki at https://wiki.gentoo.org/wiki/Zstd#Debug_symbols. A cheesy patch (*without* configurability) is: ``` Make Portage use zstd for debug info compression. Make sure binutils[zstd], elfutils[zstd], and gdb[zstd] are emerged first. --- a/bin/estrip +++ b/bin/estrip @@ -295,7 +295,7 @@ save_elf_debug() { mv "${splitdebug}" "${dst}" else local objcopy_flags="--only-keep-debug" - ${FEATURES_compressdebug} && objcopy_flags+=" --compress-debug-sections" + ${FEATURES_compressdebug} && objcopy_flags+=" --compress-debug-sections=zstd" ${OBJCOPY} ${objcopy_flags} "${src}" "${dst}" && ${OBJCOPY} --add-gnu-debuglink="${dst}" "${src}" fi ```