如何检查编译后的二进制文件是32位还是64位? [英] How can I check if a compiled binary is 32-bit or 64-bit?

查看:545
本文介绍了如何检查编译后的二进制文件是32位还是64位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台运行Lion的Mac,我刚刚下载了最新版本的apache. 我做了平常的事情:

I have a Mac running Lion and I just downloaded latest version of apache. I did the usual things:

$./configure --prefix=/Users/daniels/Sandbox
$ make
$ make install

httpd二进制文件是针对哪种体系结构进行编译的? x86或x64?有没有办法找到这个?

For what architecture is the httpd binary compiled? x86 or x64? Is there a way to find this?

我要寻找的是我想要制作一个类似于MAMP的应用程序,并且希望以某种方式编译Apache,PHP和MySQL,以便将它们放入DMG文件中,然后将其提供给其他人,他们可以运行它.

What I am looking for is that I want to make a MAMP-like application and I want to compile Apache, PHP, and MySQL in such way that I can put them in a DMG file and then give it to other people and they can run it.

推荐答案

签出file命令.

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

这篇关于如何检查编译后的二进制文件是32位还是64位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆