Fedora

libtool 的架構具體是什麼?

  • January 21, 2021

Fedora 打包libtool為 64 位:

# rpm -qi libtool |grep ^Arch
Architecture: x86_64

然而,從表面上看包內容並沒有顯示任何明顯的特定於架構的二進製文件:

# rpm -ql libtool |xargs file
/usr/bin/libtool:                          a /usr/bin/sh script, ASCII text executable, with very long lines, with escape sequences
/usr/bin/libtoolize:                       a /usr/bin/sh script, ASCII text executable, with very long lines, with escape sequences
/usr/share/aclocal/libtool.m4:             M4 macro processor script, ASCII text, with very long lines
/usr/share/aclocal/ltargz.m4:              M4 macro processor script, ASCII text
/usr/share/aclocal/ltdl.m4:                M4 macro processor script, ASCII text
/usr/share/aclocal/ltoptions.m4:           M4 macro processor script, ASCII text
/usr/share/aclocal/ltsugar.m4:             M4 macro processor script, ASCII text
/usr/share/aclocal/ltversion.m4:           M4 macro processor script, ASCII text
/usr/share/aclocal/lt~obsolete.m4:         M4 macro processor script, ASCII text
/usr/share/doc/libtool:                    directory
/usr/share/doc/libtool/AUTHORS:            ASCII text
/usr/share/doc/libtool/ChangeLog:          Non-ISO extended-ASCII text, with LF, NEL line terminators
/usr/share/doc/libtool/NEWS:               ASCII text
/usr/share/doc/libtool/README:             ASCII text
/usr/share/doc/libtool/THANKS:             UTF-8 Unicode text
/usr/share/doc/libtool/TODO:               ReStructuredText file, UTF-8 Unicode text
/usr/share/info/libtool.info-1.gz:         gzip compressed data, max compression, from Unix, original size modulo 2^32 312124
/usr/share/info/libtool.info-2.gz:         gzip compressed data, max compression, from Unix, original size modulo 2^32 51735
/usr/share/info/libtool.info.gz:           gzip compressed data, max compression, from Unix, original size modulo 2^32 4355
/usr/share/libtool:                        directory
/usr/share/libtool/build-aux:              directory
/usr/share/libtool/build-aux/compile:      a /usr/bin/sh script, ASCII text executable
/usr/share/libtool/build-aux/config.guess: a /usr/bin/sh script, ASCII text executable
/usr/share/libtool/build-aux/config.sub:   a /usr/bin/sh script, ASCII text executable
/usr/share/libtool/build-aux/depcomp:      a /usr/bin/sh script, ASCII text executable
/usr/share/libtool/build-aux/install-sh:   a /usr/bin/sh script, ASCII text executable
/usr/share/libtool/build-aux/ltmain.sh:    POSIX shell script, ASCII text executable, with escape sequences
/usr/share/libtool/build-aux/missing:      a /usr/bin/sh script, ASCII text executable
/usr/share/licenses/libtool:               directory
/usr/share/licenses/libtool/COPYING:       ASCII text
/usr/share/man/man1/libtool.1.gz:          gzip compressed data, max compression, from Unix, original size modulo 2^32 3469
/usr/share/man/man1/libtoolize.1.gz:       gzip compressed data, max compression, from Unix, original size modulo 2^32 3027

這提出了一些問題:

架構特定部分在哪裡?這些宏文件中包含一些編譯時常量?一個 32 位的 libtool 會意外打包為noarch破壞 64 位版本嗎?

libtool腳本本身嵌入了它的預設主機和建構架構,因此它在建構的每個架構上都不同。

至少有兩個其他變數libtool是依賴於架構的:

  • 庫搜尋路徑;
  • 連結器命令(它指定目標格式)。

其餘部分與libtool體系結構無關,其他一些發行版將包拆分,以便它們可以提供僅包含libtool腳本的體系結構相關包,以及包含其他所有內容的體系結構無關包。

使用錯誤libtool確實會破壞您的建構(它不會找到正確的庫,並且連結將失敗),除非它們為受影響的變數提供正確的值。

引用自:https://unix.stackexchange.com/questions/629896