如何从Mac OS X到Linux x86交叉编译? [英] How to cross compile from Mac OS X to Linux x86?

查看:1055
本文介绍了如何从Mac OS X到Linux x86交叉编译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Mac OS X 10.5.8,并希望使用GCC 4.1.2编译目标CentOS 5.3。我如何:


  1. 编译GCC 4.1.2工具链和相关工具?

  2. 使用该工具交叉编译目标CentOS 5.3?

任何帮助都非常感谢!

解决方案

您最简单的解决方案是在VM中运行CentOS 5.3(例如Sun VirtualBox )。这需要最少的设置,具有相当合理的开销(假设为Intel Mac),您可以实际测试和调试您正在建设什么。

如果你真的坚持交叉编译,你必须建立一个交叉编译器。说明这里这里,但要小心:它可能需要几天的时间才能正确,然后你仍然需要一个虚拟机来测试结果,所以我没有看到任何点这样做。


I'm running Mac OS X 10.5.8 and want to compile for target CentOS 5.3 with GCC 4.1.2. How could I:

  1. Compile GCC 4.1.2 toolchain and related tools?
  2. Use that tool to cross compile for target CentOS 5.3?

Any help is greatly appreciated!

解决方案

Your simplest solution is to just run CentOS 5.3 in a VM (e.g. Sun VirtualBox). This requires minimal setup, has quite reasonable overhead (assuming an Intel Mac), and you'll be able to actually test and debug what you are building.

If you really insist on cross-compiling, you must build a cross-compiler. Instructions are here and here, but beware: it will likely take you several days to get it right, and then you'll still need a VM to test the result, so I don't see any point in doing it that way.

这篇关于如何从Mac OS X到Linux x86交叉编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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