Fedora 打包libtool
为 64 位:
# rpm -qi libtool |grep ^Arch
Architecture: x86_64
然而,从表面看包内容并没有显示任何明显的特定于 arch 的二进制文件:
# 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 位版本吗?
答案1
该libtool
脚本本身嵌入了其默认主机和构建架构,因此它在其构建的每个架构上都是不同的。
至少有两个其他变量与libtool
架构相关:
- 库搜索路径;
- 链接器命令(它指定目标格式)。
其余部分libtool
与体系结构无关,并且其他一些发行版将程序包进行了拆分,以便它们可以提供仅包含脚本的体系结构相关程序包libtool
和包含其他所有内容的与体系结构无关的程序包。
使用错误libtool
确实会破坏您的构建(它将找不到正确的库,并且链接将失败),除非它们为受影响的变量提供正确的值。