This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Add --compress-debug-sections=zstd
ClosedPublic

Authored by MaskRay on Sep 8 2022, 6:50 PM.

Details

Summary

clang -gz=zstd a.o passes this option to the linker. This option compresses output
debug sections with zstd and sets ch_type to ELFCOMPRESS_ZSTD. As of today, very
few DWARF consumers recognize ELFCOMPRESS_ZSTD.

Use the llvm::zstd::compress API with level llvm::zstd::DefaultCompression (5),
which we may tune after we have more experience with zstd output.
zstd has built-in parallel compression support (so we don't need to do D117853
for zlib), which is not leveraged yet.

Diff Detail

Event Timeline

MaskRay created this revision.Sep 8 2022, 6:50 PM
MaskRay requested review of this revision.Sep 8 2022, 6:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 8 2022, 6:50 PM
MaskRay updated this revision to Diff 458944.Sep 8 2022, 7:00 PM
MaskRay edited the summary of this revision. (Show Details)

fix size
add link to patch

MaskRay edited the summary of this revision. (Show Details)Sep 8 2022, 7:01 PM
peter.smith accepted this revision.Sep 9 2022, 7:38 AM

LGTM. I'm taking https://groups.google.com/g/generic-abi/c/satyPkuMisk as an acceptance that ELFCOMPRESS_ZSTD will make into ELF.

This revision is now accepted and ready to land.Sep 9 2022, 7:38 AM

LGTM. I'm taking https://groups.google.com/g/generic-abi/c/satyPkuMisk as an acceptance that ELFCOMPRESS_ZSTD will make into ELF.

Thanks:) The official approval is https://groups.google.com/g/generic-abi/c/satyPkuMisk/m/KwTF_U8rBAAJ "I will add this to the ELF spec, as proposed below:"

This revision was landed with ongoing or failed builds.Sep 9 2022, 10:30 AM
This revision was automatically updated to reflect the committed changes.