Linux的交叉编译为ARM架构 [英] Linux cross-compilation for ARM architecture

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

问题描述

我感兴趣的交叉编译Linux内核的的x86主机上的ARM目标。有没有给你推荐一些好的做法?哪个是最好的交叉编译套件,你的看法?
你已经解决了一个自定义的交叉编译环境?如果是的话,你有什么建议?这是个好主意吗?

I am interested in cross-compiling a Linux kernel for an ARM target on a x86 host. Are there some good practices you recommend? Which is the best cross-compile suite in your opinion? Have you settled up a custom cross-compile environment? If yes, what advices do you have? Is it a good idea?

推荐答案

有我用于ARM / Linux工具两种方法。最简单的是直接下载pre-内置工具链。结果
:这只是工作,你可以用你的项目结果的有趣的部分得到
精读:你被卡住用gcc / binutils的取其版/ libc的,他们拿起

There are two approaches I've used for ARM/Linux tools. The easiest is to download a pre-built tool chain directly.
Pro: It just works and you can get on with the interesting part of your project
Con: You are stuck with whichever version of gcc/binutils/libc they picked

如果以后事项给你,看看的crosstool-NG 。该项目是类似Linux内核配置应用程序的配置工具。全力打造集这GCC,binutils的,libc的(GNU或者uClibc的),线程和Linux内核版本和的crosstool-NG没有休息(即下载的焦油球,配置工具,并建立它们)。结果
:你得到你的配置过程中选择什么结果
精读:你得到你的配置过程中选择到底是什么

If the later matters to you, check out crosstool-ng. This project is a configuration tool similar to the Linux kernel configuration application. Set which versions of gcc, binutils, libc (GNU or uCLibc), threading, and Linux kernel to build and crosstool-ng does the rest (i.e. downloads the tar balls, configures the tools, and builds them).
Pro: You get exactly what you selected during the configuration
Con: You get exactly what you selected during the configuration

这意味着你承担的编译器/ binutil / libc和其相关的特征/缺点/错误的选择承担全部责任。此外,如在评论中提到,有一些痛苦涉及的binutils选择的版本,C库等,因为不是所有的组合一定共同努力,甚至建立。

meaning you take on full responsibility for the choice of compiler/binutil/libc and their associated features/shortcomings/bugs. Also, as mentioned in the comments, there is some "pain" involved in selecting the versions of binutils, C library etc. as not all combinations necessarily work together or even build.

一个混合的方法可能是先从pre-内置工具,后来又与在必要时通过的crosstool-ng的定制解决方案替换它们。

One hybrid approach might be to start with the pre-built tools and replace them later with a custom solution via crosstool-ng if necessary.

更新:答案原本使用的是 codeSourcery工具作为$ p $对内置工具链的一个例子。在codeSourcery工具,ARM可以自由地<一个href=\"http://www.mentor.com/embedded-software/sourcery-tools/sourcery-$c$cbench/editions/lite-edition/\"相对=nofollow> Mentor Graphics的下载,但他们现在被称为的Sourcery codeBench,必须从Mentor Graphics公司购买。其他选项包括现在 Linaro的以及在Android,Ubuntu和其他人分发具体工具。

Update: The answer originally used the CodeSourcery tools as an example of a pre-built tool chain. The CodeSourcery tools for ARM were free to download from Mentor Graphics, but they are now called the Sourcery CodeBench and must be purchased from Mentor Graphics. Other options now include Linaro as well as distribution specific tools from Android, Ubuntu, and others.

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

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