Provided by: debhelper_13.24.2ubuntu1_all bug

名前

       dh_strip - 実行ファイル、共有ファイル、静的ライブラリのデバッグ情報を削る

書式

       dh_strip [debhelper オプション] [-Xitem] [--dbg-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.

       本プログラムはパッケージビルドディレクトリ以下を探索し、どのファイルからデバッグ情報を取り除くべきかを見
       つけ出します。本プログラムは、file(1) コマンドを利用し、ファイルパーミッション、ファイル名を利用して、ど
       のファイルが共有ライブラリ (*.so)、実行可能バイナリ、静的ライブラリ (lib*.a)、デバッグ用ライブラリ
       (lib*_g.a, debug/*.so) であるかを判断し、該当する場合は、デバッグシンボルをできる限り取り除きます (デバッ
       グ用ライブラリについては全く何もしません)。多くの場合で、本プログラムは非常に良い推定を行い、正しくデバッ
       グシンボルの除去を行います。

       自動的にファイルがモジュールであるかどうかを見分けるのは難しく、また、どうやってモジュールからデバッグ情
       報を除外すれば良いかを決定するのも難しい為、dh_strip は、.o を拡張子に持つファイルのようなバイナリモ
       ジュールからデバッグ情報の除去を行う事について、未だサポートしていません。

オプション

       -Xitem, --exclude=item
           item を名前に含むようなファイルを、デバッグ情報除去の対象から外します。もし、複数のファイルを処理させ
           ないように指定したければ、本オプションを複数回指定することによって行えます。

       --dbg-package=package
           このオプションは、現在特別な目的のためのオプションであり、通常必要ありません。ほとんどの場合、新しい
           ソースパッケージでは  debhelper が自動的にデバッグパッケージ ("dbgsym パッケージ") を生成するので、こ
           のオプションを使う理由は少ないはずです。手動で作られた --dbg-package を自動生成されたデバッグシンボル
           パッケージで置き換えたい場合は --dbgsym-migration オプションを参照して下さい。

           dh_strip   を使ってパッケージからデバッグシンボルを取き、指定のデバッグ用パッケージのパッケージビルド
           ディレクトリ内に独立したファイルとしてデバッグシンボルを保存します。

           例えば、ビルド予定のパッケージとして、libfoo、foo  があり、foo-dbg パッケージにはデバッグシンボルを含
           めておきたい場合、dh_strip--dbg-package=foo-dbg を実行してください。

           This  option  implies  --no-automatic-dbgsym  and  cannot  be   used   with   --automatic-dbgsym   or
           --dbgsym-migration.

       -k, --keep-debug
           このオプションは、現在特別な目的のためのオプションであり、通常必要ありません。ほとんどの場合、新しい
           ソースパッケージでは  debhelper が自動的にデバッグパッケージ ("dbgsym パッケージ") を生成するので、こ
           のオプションを使う理由は少ないはずです。手動で作られた --dbg-package を自動生成されたデバッグシンボル
           パッケージで置き換えたい場合は --dbgsym-migration オプションを参照して下さい。

           デバッグシンボルが取り除かれる一方、パッケージビルドディレクトリ以下にある usr/lib/debug/  ディレクト
           リへ取り除いたデバッグシンボルを取り置きます。--dbg-package  オプションの方が本オプションよりも使うの
           は易しいのですが、本オプションは --dbg-package オプションよりも柔軟な指定が可能です。

           This option implies --no-automatic-dbgsym and cannot be used with --automatic-dbgsym.

       --dbgsym-migration=package-relation
           このオプションは、手動 (--dbg-package) で作成した "-dbg" パッケージから自動生成されたデバッグシンボル
           パッケージへ移行するのに利用されます。このオプションでは、(現在では廃止となっている) -dbg  パッケージ
           とファイルが衝突するのを避けるためにデバッグシンボルパッケージに追加される正しい Replaces 及び Breaks
           の依存関係を記述する筈です。

           This  option  implies  --automatic-dbgsym  and  cannot  be  used  with --keep-debug, --dbg-package or
           --no-automatic-dbgsym.

           例:

             dh_strip --dbgsym-migration='libfoo-dbg (<< 2.1-3~)'

             dh_strip --dbgsym-migration='libfoo-tools-dbg (<< 2.1-3~), libfoo2-dbg (<< 2.1-3~)'

       --automatic-dbgsym, --no-automatic-dbgsym
           可能な際に dh_strip がデバッグシンボルパッケージを作るかどうかをコントロールします。

           デフォルトはデバッグシンボルパッケージを作成します。

       --ddebs, --no-ddebs
           --automatic-dbgsym--no-automatic-dbgsym の歴史的な名前です。

       --ddeb-migration=package-relation
           --dbgsym-migration の歴史的な名前です。

       --keep-lto
           Sections containing information generated by -flto -ffat-lto-objects are normally removed from static
           archives, because the streaming format changes even in minor GCC versions, and because cross  package
           link time optimizations are normally not desired.  This option allows to keep this information in the
           static libraries.

付記

       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 ポリシー バージョン 3.0.1

参照

       debhelper(7)

       このプログラムは debhelper の一部です。

作者

       Joey Hess <joeyh@debian.org>

13.24.2ubuntu1                                     2025-05-22                                        DH_STRIP(1)