Debian: 混乱した ld.so マンページ文書

Debian: 混乱した ld.so マンページ文書

ld.so私はDebian安定システムのマンページを見ています。現在は次のように言います。:

$ man ld.so
[...]
NOTES
   Hardware capabilities
       Some shared objects are compiled using hardware-specific instructions which do not exist on every CPU.  Such objects should be installed in directories whose names define the required hardware ca‐
       pabilities, such as /usr/lib/sse2/.  The dynamic linker checks these directories against the hardware of the machine and selects the most suitable version of a given shared object.  Hardware capa‐
       bility directories can be cascaded to combine CPU features.  The list of supported hardware capability names depends on the CPU.  The following names are currently recognized:

私が驚いたのは最後の文でした。

現在認識されている名前は次のとおりです。

現在、これは事実ではありません(または少なくともこれ以上ではありません)。私が見つけることができるものは次のとおりです。

% cat /etc/ld.so.conf.d/*
/usr/lib/x86_64-linux-gnu/libfakeroot
# Multiarch support
/usr/local/lib/i386-linux-gnu
/lib/i386-linux-gnu
/usr/lib/i386-linux-gnu
/usr/local/lib/i686-linux-gnu
/lib/i686-linux-gnu
/usr/lib/i686-linux-gnu
# libc default configuration
/usr/local/lib
# Multiarch support
/usr/local/lib/x86_64-linux-gnu
/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu
# Legacy biarch compatibility support
/lib32
/usr/lib32
# Legacy biarch compatibility support
/libx32
/usr/libx32

ld.so私のコンピュータで本当に魔法のようにライブラリを見つけることができますか?/usr/lib/sse2/

引用:

% apt-cache policy manpages
manpages:
  Installed: 5.10-1
  Candidate: 5.10-1
  Version table:
 *** 5.10-1 500
        500 http://deb.debian.org/debian bullseye/main amd64 Packages
        500 http://deb.debian.org/debian bullseye/main i386 Packages
        100 /var/lib/dpkg/status

完成度を上げるために、Bullseye 32ビットchrootの同じ出力は次のとおりです。

% cat /etc/ld.so.conf.d/*
/usr/lib/i386-linux-gnu/libfakeroot
# Multiarch support
/usr/local/lib/i386-linux-gnu
/lib/i386-linux-gnu
/usr/lib/i386-linux-gnu
/usr/local/lib/i686-linux-gnu
/lib/i686-linux-gnu
/usr/lib/i686-linux-gnu
# libc default configuration
/usr/local/lib

ベストアンサー1

以下はglibc(2.37以前)ベースのシステムです。

はい、そうです。しかし、x86を使用しているので、32ビットバイナリでのみ動作します。例を見るlibspeex1 どの船ライブラリは/usr/lib/i386-linux-gnu/(すべての32ビットx86システム用)および/usr/lib/i386-linux-gnu/sse2/(SSE2をサポートする32ビットx86システム用)利用可能です。別の例はlibx264-160 どの船/usr/lib/i386-linux-gnu/このライブラリは/usr/lib/i386-linux-gnu/i686/sse2/(SSE2をサポートするi686準拠の32ビットx86システム用)にあります。

ld.so.confld.soこれは、などの機能関連ディレクトリのリストには依存しません。息子検索パス内のディレクトリのディレクトリ。走れば

/sbin/ldconfig -v 2>/dev/null | grep -A3 hwcap

システムで使用されている機能関連ディレクトリを表示できます(つまりこれにはライブラリが含まれており、ldconfigこれについて知っています。)

検索パス(2.37 glibcの場合)を見つけるもう1つの方法は次のとおりです。

% LD_DEBUG=libs LD_LIBRARY_PATH=. /bin/true
   3626040:     find library=libc.so.6 [0]; searching
   3626040:      search path=./glibc-hwcaps/x86-64-v3:./glibc-hwcaps/x86-64-v2:.                (LD_LIBRARY_PATH)

おすすめ記事