交叉编译器对于mac os x [英] Cross compiler for linux on mac os x

查看:205
本文介绍了交叉编译器对于mac os x的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在互联网上阅读了很多关于在mac os x上为linux创建交叉编译器的文档,但是不能接受任何工作。

I've been reading lots of documents on the internet about creating a cross compiler for linux on mac os x but can't seam to get any to work.

它接缝好像没有人可以帮助我的问题:让GMP与GCC 4.5.2一起工作

It seams as if no one can help me with the question: Getting GMP to work with GCC 4.5.2

有没有easy'er方法来创建交叉编译器?

Is there any easy'er way to create a cross compiler?

推荐答案

为了构建不同于你的构建主机的二进制文件,你需要远远不仅仅是一个交叉编译器 - 你需要一个完整的工具链,

In order to build binaries for architectures different that your build host, you need far more than just a cross-compiler - you need a full-blown toolchain, which can be a real pain to create, as you probably discovered.

有几种方法:


  • 在虚拟机中使用正确的Linux发行版,例如VirtualBox。如果你只想在MacOSX / x86_64主机上为Linux / i386构建二进制文件,这在我看来是最简单,最安全和最干净的解决方案。它不是一个交叉编译器,当然,但它的工作,它有额外的优势,你可以实际测试你的可执行文件。

  • Use a proper Linux distribution in a virtual machine, such as VirtualBox. If you only want to build binaries for Linux/i386 on an MacOSX/x86_64 host, this is - in my opinion - the easiest, safest and most clean solution. It is not a cross-compiler, of course, but it works and it has the added advantage that you can actually test your executables.

使用脚本 crosstool-NG (原始 crosstool 的后代)自动构建

Use a script such crosstool-NG (a descendant of the original crosstool) to automatically build the toolchain - definitely easier than building it on your own, although you may have to compromise for slightly older compiler versions.

这篇关于交叉编译器对于mac os x的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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