man-pages/man1/dh_strip.1.html
2021-03-31 01:06:50 +01:00

238 lines
6.8 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of DH_STRIP</TITLE>
</HEAD><BODY>
<H1>DH_STRIP</H1>
Section: Debhelper (1)<BR>Updated: 2020-03-27<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
dh_strip - strip executables, shared libraries, and some static libraries
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>dh_strip</B> [<I>debhelper options</I>] [<B>-X</B><I>item</I>] [<B>--dbg-package=</B><I>package</I>] [<B>--keep-debug</B>]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>dh_strip</B> is a debhelper program that is responsible for stripping
executables, shared libraries, and static libraries that are not used for
debugging.
<P>
This program examines your package build directories and works out what
to strip on its own. It uses <B><A HREF="/cgi-bin/man/man2html?1+file">file</A></B>(1) and file permissions and filenames
to figure out what files are shared libraries (<I>*.so</I>), executable binaries,
and static (<I>lib*.a</I>) and debugging libraries (<I>lib*_g.a</I>, <I>debug/*.so</I>), 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.
<P>
Since it is very hard to automatically guess if a file is a
module, and hard to determine how to strip a module, <B>dh_strip</B> does not
currently deal with stripping binary modules such as <I>.o</I> files.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="1"><B>-X</B><I>item</I>, <B>--exclude=</B><I>item</I><DD>
Exclude files that contain <I>item</I> anywhere in their filename from being
stripped. You may use this option multiple times to build up a list of
things to exclude.
<DT id="2"><B>--dbg-package=</B><I>package</I><DD>
<B>This option is a now special purpose option that you normally do not
need</B>. In most cases, there should be little reason to use this
option for new source packages as debhelper automatically generates
debug packages (``dbgsym packages''). <B>If you have a manual
--dbg-package</B> that you want to replace with an automatically
generated debug symbol package, please see the <B>--dbgsym-migration</B>
option.
<P>
Causes <B>dh_strip</B> to save debug symbols stripped from the packages it acts on
as independent files in the package build directory of the specified debugging
package.
<P>
For example, if your packages are libfoo and foo and you want to include a
<I>foo-dbg</I> package with debugging symbols, use <B>dh_strip --dbg-package=</B><I>foo-dbg</I>.
<P>
This option implies <B>--no-automatic-dbgsym</B> and <I>cannot</I> be used
with <B>--automatic-dbgsym</B> or <B>--dbgsym-migration</B>.
<DT id="3"><B>-k</B>, <B>--keep-debug</B><DD>
<B>This option is a now special purpose option that you normally do not
need</B>. In most cases, there should be little reason to use this
option for new source packages as debhelper automatically generates
debug packages (``dbgsym packages''). <B>If you have a manual
--dbg-package</B> that you want to replace with an automatically
generated debug symbol package, please see the <B>--dbgsym-migration</B>
option.
<P>
Debug symbols will be retained, but split into an independent
file in <I>usr/lib/debug/</I> in the package build directory. <B>--dbg-package</B>
is easier to use than this option, but this option is more flexible.
<P>
This option implies <B>--no-automatic-dbgsym</B> and <I>cannot</I> be used
with <B>--automatic-dbgsym</B>.
<DT id="4"><B>--dbgsym-migration=</B><I>package-relation</I><DD>
This option is used to migrate from a manual ``-dbg'' package (created
with <B>--dbg-package</B>) to an automatic generated debug symbol
package. This option should describe a valid <B>Replaces</B>- and
<B>Breaks</B>-relation, which will be added to the debug symbol package to
avoid file conflicts with the (now obsolete) -dbg package.
<P>
This option implies <B>--automatic-dbgsym</B> and <I>cannot</I> be used with
<B>--keep-debug</B>, <B>--dbg-package</B> or <B>--no-automatic-dbgsym</B>.
<P>
Examples:
<P>
<PRE>
dh_strip --dbgsym-migration='libfoo-dbg (&lt;&lt; 2.1-3~)'
dh_strip --dbgsym-migration='libfoo-tools-dbg (&lt;&lt; 2.1-3~), libfoo2-dbg (&lt;&lt; 2.1-3~)'
</PRE>
<DT id="5"><B>--automatic-dbgsym</B>, <B>--no-automatic-dbgsym</B><DD>
Control whether <B>dh_strip</B> should be creating debug symbol packages
when possible.
<P>
The default is to create debug symbol packages.
<DT id="6"><B>--ddebs</B>, <B>--no-ddebs</B><DD>
Historical name for <B>--automatic-dbgsym</B> and <B>--no-automatic-dbgsym</B>.
<DT id="7"><B>--ddeb-migration=</B><I>package-relation</I><DD>
Historical name for <B>--dbgsym-migration</B>.
<DT id="8"><B>--keep-lto</B><DD>
Sections containing information generated by <B>-flto -ffat-lto-objects</B>
are normally removed from static archives, because the streaming
format changes even in minor <FONT SIZE="-1">GCC</FONT> versions, and because cross package
link time optimizations are normally not desired. This option allows
to keep this information in the static libraries.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>NOTES</H2>
If the <B></B><FONT SIZE="-1"><B>DEB_BUILD_OPTIONS</B></FONT><B></B> environment variable contains <B>nostrip</B>,
nothing will be stripped, in accordance with Debian policy (section
10.1 ``Binaries''). This will also inhibit the automatic creation of
debug symbol packages.
<P>
The automatic creation of debug symbol packages can also be prevented
by adding <B>noautodbgsym</B> to the <B></B><FONT SIZE="-1"><B>DEB_BUILD_OPTIONS</B></FONT><B></B> environment
variable. However, <B>dh_strip</B> will still add debuglinks to <FONT SIZE="-1">ELF</FONT>
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).
<A NAME="lbAG">&nbsp;</A>
<H2>CONFORMS TO</H2>
Debian policy, version 3.0.1
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?7+debhelper">debhelper</A></B>(7)
<P>
This program is a part of debhelper.
<A NAME="lbAI">&nbsp;</A>
<H2>AUTHOR</H2>
Joey Hess &lt;<A HREF="mailto:joeyh@debian.org">joeyh@debian.org</A>&gt;
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="9"><A HREF="#lbAB">NAME</A><DD>
<DT id="10"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="11"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="12"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="13"><A HREF="#lbAF">NOTES</A><DD>
<DT id="14"><A HREF="#lbAG">CONFORMS TO</A><DD>
<DT id="15"><A HREF="#lbAH">SEE ALSO</A><DD>
<DT id="16"><A HREF="#lbAI">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:11 GMT, March 31, 2021
</BODY>
</HTML>