从 x86 交叉编译 arm [英] Cross compiling for arm from x86

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

问题描述

我正在尝试将 .ko 内核模块插入到在 arm 处理器中运行的 linux 中.我在台式电脑上构建了一个 .ko 文件,它是 x86 的.我如何交叉编译它以支持规范.我是这个领域的新手.

I am trying to insert a .ko kernel module into the linux running in arm processor. I built a .ko file in my desk PC which is a x86 one. How do I cross compile it to arm specs. I am new to this field.

提前致谢

推荐答案

为此,您需要先下载 ARM 编译器.我建议你从 http://www.linaro.org/downloads/ 下载编译器然后设置CROSS_COMPILE 环境变量到 arm-linux-gcc.

For that you need to download the ARM compilers first. I suggest you download the compiler from http://www.linaro.org/downloads/ then set the CROSS_COMPILE environment variable to arm-linux-gcc.

在PATH变量中设置bin目录路径.可以通过export PATH=$PATH:/path/to/arm/binaries/来完成

set the bin directory path in PATH variable.You can do it by export PATH=$PATH:/path/to/arm/binaries/

最后编译代码然后在ARM中运行.

Finally compile the code then run in ARM.

使用 file 是否是 ARM 可执行文件.

use file <filename> whether it is ARM executable or not.

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

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