[llvm-objcopy] Support --decompress-debug-sections when zlib is disabled
authorFangrui Song <i@maskray.me>
Wed, 12 Oct 2022 18:52:05 +0000 (11:52 -0700)
committerFangrui Song <i@maskray.me>
Wed, 12 Oct 2022 18:52:05 +0000 (11:52 -0700)
commite18b7c7ae0c13909d7f1304aee8621781a3c27a0
treea016d934f49155829701b84074b0c42c6a0794b8
parente143e52c2201b689d2de39394f059f8ef1a27fc4
[llvm-objcopy] Support --decompress-debug-sections when zlib is disabled

When zlib is disabled at build time, the diagnostic `LLVM was not compiled with
LLVM_ENABLE_ZLIB: cannot decompress` for --decompress-debug-sections may be
inaccurate: if zstd is enabled, we should still support zstd decompression.

It's not useful to test zlib and zstd. Just remove the diagnostic and add a new
one before `compression::decompress`.

This fixes compress-debug-sections-zstd.test

Reviewed By: mariusz-sikora-at-amd, jhenderson, phosek

Differential Revision: https://reviews.llvm.org/D135744
llvm/lib/ObjCopy/ELF/ELFObject.cpp
llvm/test/tools/llvm-objcopy/ELF/decompress-debug-sections-unsupported-zlib.test [new file with mode: 0644]
llvm/tools/llvm-objcopy/ObjcopyOptions.cpp