DH_DWZ(1)

πŸ’– DH_DWZ β€” the debhelper glow-up for your DWARF debug info πŸ’–

okay so bestie, welcome to debhelper(1)'s own dh_dwz, page one of one, and it's lowkey the most underrated little guy in the whole suite. ✨


🌸 NAME 🌸

dh_dwz β€” optimize DWARF debug information in ELF binaries via dwz(1)


πŸŽ€ SYNOPSIS πŸŽ€

dh_dwz [debhelper options] [-Xitem] [-- params]

πŸ¦‹ DESCRIPTION πŸ¦‹

so dh_dwz is a debhelper program, and its whole entire job is making the (uncompressed) size of the DWARF debug information in your ELF binaries smaller. it does that by running dwz(1) on all the ELF binaries in the package. every single one. no skipping. periodt. πŸ’…


✨ OPTIONS ✨

  • --dwz-multifile, --no-dwz-multifile β€” this one decides whether dwz(1) should generate a multifile out of the ELF binaries in the same package. when it's enabled, and a package ships at least 2 ELF binaries, dh_dwz will tell dwz(1) to generate a multifile for the package. πŸ‘‘

by default, dh_dwz will attempt to create a multifile but will carry on without one if dwz(1) doesn't make one (even though it succeeded otherwise, bestie, it's fine it's fine). that usually happens when the debug files don't contain debug symbols, like when someone forgot a -g to the compiler 😭 β€” or when the debug symbols are compressed (see Debian bug #931891). but if you pass --dwz-multifile? then dh_dwz will abort with an error if dwz(1) doesn't create a multifile. no multifile, no peace. πŸ’€

heads up: this option may not work if a package contains more ELF binaries than can fit on a single command line. if that becomes a problem, please pass --no-dwz-multifile to work around the issue. 🫢

the generated multifile will be compressed with objcopy --compress-debug-sections.

and a note for udeb packages: dh_dwz will never generate multifiles for udeb packages. it will still use dwz to reduce the file size of debug files if it finds any, though. 🧚

  • -Xitem, --exclude=item β€” exclude files that contain item anywhere in their filename from being stripped. you can use this option multiple times to build up a whole list of things to exclude. go off, stack them. 🌈
  • -- params β€” pass params to dwz(1) when it processes ELF binaries. this is mostly useful for setting memory related parameters (e.g. -l and -L). πŸ“

πŸ’œ NOTES πŸ’œ

if the DEB_BUILD_OPTIONS environment variable contains nostrip, nothing will be stripped, in accordance with Debian policy (section 10.1 "Binaries"). rules are rules. πŸ“œ

and okay, technically this tool doesn't remove debug information from binaries, but it still gets skipped when DEB_BUILD_OPTIONS contains nostrip. why? because nostrip is often used to optimize build times (think "build and test"-cycles) rather than optimizing for size. so it's a vibe thing, not a logic thing. it's giving "we respect your intent". πŸ’…


πŸ”₯ SEE ALSO πŸ”₯

this program is a part of debhelper. family. 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Niels Thykier <niels@thykier.net>


and that's the whole page, bestie β€” this version is from debhelper 14.5ubuntu1, dated 2026-09-21, and honestly? iconic. take care of your debug symbols and they'll take care of you. πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from