交叉编译或编译为本地CPU拱门 [英] Cross Compile or Compile Native for CPU Arch

查看:194
本文介绍了交叉编译或编译为本地CPU拱门的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在编写软件,CPU拱有关,比如在x86或C code运行在ARM CPU上运行C $ C $℃。一般存在两种方式去了解这个编译code,无论是交叉编译的ARM CPU弓(如果你比如在x86系统上开发)或code复制到本地拱CPU系统并天真地对其进行编译。

When writing software that is CPU arch dependent, such as C code running on x86 or C code running on ARM cpus. There generally is two ways to go about compiling this code, either Cross-Compile to the ARM CPU arch (if you're developing on an x86 system for example) or copy your code to a native arch cpu system and compile it naively.

我不知道是否有原生的方式相较于交叉编译的方法有什么好处?我注意到,Fedora的ARM团队使用慢/低功率ARM设备的构建,服务器集群,以天真编译他们的Fedora ARM旋...当然由Red Hat支持的项目有访问运行x86 CPU的一些功能强大的构建服务器可能获得1/2完成时的作业...那么,为什么他们的选择?我失去了通过交叉编译我的软件的东西吗?

I'm wondering if there is a benefit to the native approach vs the cross-compile approach? I noticed that the Fedora ARM team is using a build-server cluster of slow/low power ARM devices to "naively" compile their Fedora ARM spin... surely a project backed by Red Hat has access to some powerful build servers running x86 cpus that could get the job done in 1/2 the time... so why their choice? Am I missing something by cross-compiling my software?

推荐答案

通过交叉编译的.C范围内没有技术上你不缺少什么 - >的.o - > a.out的(或其他);一个交叉编译器会给你同样的二进制文件作为一个本地编译器(版本等虽然)

No technically you're not missing anything by cross-compiling within the context of .c -> .o -> a.out (or whatever); A cross compiler will give you the same binary as a native compiler (versions etc. notwithstanding)

该建筑的后发优势本身来自后期编译测试和管理复杂的系统。

The "advantages" of building natively come from post-compile testing and managing complex systems.

1)如果我可以编译我能到任何错误/问题后快速运行单元测试快速的周期为presumably比交叉编译周期短;

1) If I can run unit-tests quickly after compiling I can get to any bugs/issues quickly the cycle is presumably shorter than the cross-compiling cycle;

2)如果我编译有它使用,那么构建,部署,然后用它们来构建我的目标很可能会在本机平台更容易的第三方库的一些目标软件;我不想处理交叉编译生成的,因为其中一半建有由疯狂的猴子,让跨书面程序编译他们的痛苦。

2) if I am compiling some target software that has 3rd-party libraries that it uses, then building, deploying and then using them to build my target would probably be easier on native platform; I don't want to deal with the cross-compile builds of those because half of them have build processes written by crazy monkeys that make cross compiling them a pain.

通常对于大多数的事情之一会设法得到一个基础构建和原生的编译休息。除非我有一个生病的建立在我的交叉编译器是超级邪恶的快,我的时候,我保存有值得设置,使的东西(比如单元测试和依赖关系管理)更容易。

Typically for most things one would try to get to a base build and the compile the rest natively. Unless I have a sick set up where my cross compiler is super wicked fast and I the time I save there is worth the set up required to make the rest of the things (such as unit testing and dependencies management) easier.

至少那些是我的想法。

这篇关于交叉编译或编译为本地CPU拱门的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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