DH_STRIP(1) | Debhelper | DH_STRIP(1) |
dh_strip - strip executables, shared libraries, and some static libraries
dh_strip [debhelper options] [-Xitem] [--dbg-package=package] [--keep-debug]
dh_strip is a debhelper program that is responsible for stripping out debug symbols in executables, shared libraries, and static libraries that are not needed during execution.
This program examines your package build directories and works out what to strip on its own. It uses file(1) and file permissions and filenames to figure out what files are shared libraries (*.so), executable binaries, and static (lib*.a) and debugging libraries (lib*_g.a, debug/*.so), and strips each as much as is possible. (Which is not at all for debugging libraries.) In general it seems to make very good guesses, and will do the right thing in almost all cases.
Since it is very hard to automatically guess if a file is a module, and hard to determine how to strip a module, dh_strip does not currently deal with stripping binary modules such as .o files.
Causes dh_strip to save debug symbols stripped from the packages it acts on as independent files in the package build directory of the specified debugging package.
For example, if your packages are libfoo and foo and you want to include a foo-dbg package with debugging symbols, use dh_strip --dbg-package=foo-dbg.
This option implies --no-automatic-dbgsym and cannot be used with --automatic-dbgsym or --dbgsym-migration.
Debug symbols will be retained, but split into an independent file in usr/lib/debug/ in the package build directory. --dbg-package is easier to use than this option, but this option is more flexible.
This option implies --no-automatic-dbgsym and cannot be used with --automatic-dbgsym.
This option implies --automatic-dbgsym and cannot be used with --keep-debug, --dbg-package or --no-automatic-dbgsym.
Examples:
dh_strip --dbgsym-migration='libfoo-dbg (<< 2.1-3~)' dh_strip --dbgsym-migration='libfoo-tools-dbg (<< 2.1-3~), libfoo2-dbg (<< 2.1-3~)'
The default is to create debug symbol packages.
If the DEB_BUILD_OPTIONS environment variable contains nostrip, nothing will be stripped, in accordance with Debian policy (section 10.1 "Binaries"). This will also inhibit the automatic creation of debug symbol packages.
The automatic creation of debug symbol packages can also be prevented by adding noautodbgsym to the DEB_BUILD_OPTIONS environment variable. However, dh_strip will still add debuglinks to ELF binaries when this flag is set. This is to ensure that the regular deb package will be identical with and without this flag (assuming it is otherwise "bit-for-bit" reproducible).
Debian policy, version 3.0.1
debhelper(7)
This program is a part of debhelper.
Joey Hess <joeyh@debian.org>
2024-03-01 | 13.14.1ubuntu5 |