[PATCH] D117853: [ELF] Parallelize --compress-debug-sections=zlib

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 21 01:37:28 PST 2022


alexander-shaposhnikov added inline comments.


================
Comment at: lld/ELF/OutputSections.cpp:292
+#if LLVM_ENABLE_ZLIB
+static SmallVector<uint8_t, 0> deflateShard(ArrayRef<uint8_t> in, int level,
+                                            bool isLast) {
----------------
MaskRay wrote:
> alexander-shaposhnikov wrote:
> > I'm wondering if you have considered using llvm/Support/Compression.h
> > (the implementation there appears to contain some bits to make it msan-friendly + error handling, but I'm not closely familiar with that code)
> The code is largely lld/ELF specific. If I add the code to llvm/Support/Compression.h, LLVMSupport will get bloated. Technically llvm-objcopy --compress-debug-sections can use the code as well but the two projects may have different tweaks and sharing code won't help much in my opinion.
just in case - after looking at https://zlib.net/manual.html and https://llvm.org/doxygen/Compression_8cpp_source.html -
the return values of `deflateInit2`, `deflate` or `compress2` are not ignored there.

p.s. Compression.h contains wrappers around compress2, but what's going on here is a bit different,
(compression of chunks + no headers), so, yeah, it answers my question above.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117853/new/

https://reviews.llvm.org/D117853



More information about the llvm-commits mailing list