为什么“ arch”输出“ i386”?


6

当我$ arch在10.9 2012 MacBook Pro上运行时,得到输出

i386

的联机帮助页上arch

the arch command is 2-way universal, 32-bit only

但是,$ file "$(which arch)"

/usr/bin/arch: Mach-O universal binary with 2 architectures
/usr/bin/arch (for architecture x86_64):        Mach-O 64-bit executable x86_64
/usr/bin/arch (for architecture i386):  Mach-O executable i386

OTOH,python2.7作为64位可执行文件运行:

$ /usr/bin/python2.7 -c 'import sys; print "%x" % sys.maxint'
7fffffffffffffff

另外,内核显然是64位的:

$ file /mach_kernel 
/mach_kernel: Mach-O 64-bit executable x86_64

uname 同意:

$ uname -m
x86_64

..还是吗?

$ uname -p
i386

Answers:


5

干得好:

uname -p 打印机器处理器体系结构名称。

uname -m 打印机器硬件名称。

没有参数的arch命令显示计算机的体系结构类型。

最终我怀疑这是您想要的答案:https : //stackoverflow.com/questions/12763296/os-x-arch-command-incorrect

为了进一步避免混乱,请运行:

$arch
i386
$machine  
i486
$uname -m
x86_64
$uname -p
i386

好的,arch它以32位或64位运行,但是仅报告体系结构是PPC还是Intel [派生],并使用i386标签而不是来报告Intel intel。我想这就是“仅2位通用32位”的含义。
2014年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.