如何查看静态库文件的编译平台 [英] How to see the compilation platform of a static library file

查看:97
本文介绍了如何查看静态库文件的编译平台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个静态库文件.我如何查看它是在i386还是在arm平台中编译的.谢谢.

I had a static library file. How can I see whether it is compiled in i386 or in arm platform. Thanks.

推荐答案

在Unix(和类似的Linux或Minix)系统中,您可以使用文件"实用程序:

In Unix (and similar - say, Linux or Minix) systems, you can use the "file" utility:

%file /lib/libc.so.7
libc.so.7: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, stripped

(%表示shell提示符,不是命令的一部分)

(the % indicates a shell prompt and is not part of the command)

对于Windows,我不知道是否存在内置命令,但是如果没有,您可以在此页面上找到该实用程序:

As for Windows, I don't know if there is a built-in command already present, but if not, you can find the utility on this page: http://gnuwin32.sourceforge.net/packages.html (the file package is about 1/3 down the page).

对于静态库(.a文件),您首先需要解压缩它们并检查.o文件:

For static libraries (.a files), you first need to extract them and check a .o file:

%cp /usr/lib/libchipmunk.a .
%ar -x libchipmunk.a
%file *.o
chipmunk.c.o: ELF 64-bit LSB relocatable, x86-64, version 1 (FreeBSD), not stripped
<snip>

警告: ar -x ...将污染本地目录,因此请务必先将文件复制到其他位置(例如/tmp/something)!

WARNING: ar -x ... will pollute the local directory, so be sure to copy the files somewhere else (say /tmp/something) first!

我敢肯定有一种方法可以直接检入这些文件,但这同样有效!

I'm sure there is a way to directly check into these files, but this works just as well!

这篇关于如何查看静态库文件的编译平台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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