Scroll to navigation

DH_STRIP(1) Debhelper DH_STRIP(1)

名前

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 を拡張子に持つファイルのようなバイナリモジュールからデバッグ情報の除去を行う事について、未だサポートしていません。

オプション

item を名前に含むようなファイルを、デバッグ情報除去の対象から外します。もし、複数のファイルを処理させないように指定したければ、本オプションを複数回指定することによって行えます。
このオプションは、現在特別な目的のためのオプションであり、通常必要ありません。ほとんどの場合、新しいソースパッケージでは 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.

このオプションは、現在特別な目的のためのオプションであり、通常必要ありません。ほとんどの場合、新しいソースパッケージでは 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.

このオプションは、手動 (--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~)'
    
可能な際に dh_strip がデバッグシンボルパッケージを作るかどうかをコントロールします。

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

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

付記

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>

2024-03-27 13.15.3