在 solaris x86 上不支持 64 位

Does ar not support 64 bit on solaris x86?

本文关键字:不支持 solaris x86      更新时间:2023-10-16

我的构建在 solaris x86 上以 64 位提升失败。原因是 ar 命令无法将 *.o 打包为 64 位静态库。谁能帮上忙?感谢您的意见以下是我的测试:

% ar rc test.a date_generators.o greg_month.o greg_weekday.o 
% file *
date_generators.o:      ELF 64-bit LSB relocatable AMD64 Version 1
greg_month.o:   ELF 64-bit LSB relocatable AMD64 Version 1
greg_weekday.o: ELF 64-bit LSB relocatable AMD64 Version 1
test.a:         current ar archive, 32-bit symbol table
% ar
usage: ar -d[-SvV] archive file ...
ar -m[-abiSvV] [posname] archive file ...
ar -p[-vV][-sS] archive [file ...]
ar -q[-cuvSV] [-abi] [posname] [file ...]
ar -r[-cuvSV] [-abi] [posname] [file ...]
ar -t[-vV][-sS] archive [file ...]
ar -x[-vV][-sSCT] archive [file ...]

您的test.a文件确实包含 64 个库,它只是它的符号表,它是 32 位的,但这并不妨碍 64 位链接工作。

如果你真的想file声明它有一个 64 位符号表,你可以运行:

ar Src test.a date_generators.o greg_month.o greg_weekday.o