如何交叉编译ARM的自动工具项目? [英] How to cross-compile a autotools project for ARM?

查看:136
本文介绍了如何交叉编译ARM的自动工具项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望交叉编译使用GNU autotools构建系统的现有库.我在主机上安装了Linaro arm-gcc工具链,并且能够直接使用arm-gcc编译小程序.

I am looking to cross-compile an existing library which uses GNU autotools build system. I have a Linaro arm-gcc toolchain installed in my host machine and I am able to compile small programs directly using arm-gcc.

  • 主机:Ubuntu 12.04 Intel x64
  • 目标计算机:Ubuntu 14.04 ARM 32位(类似于Raspberry-Pi的主板)
  • Host machine: Ubuntu 12.04 Intel x64
  • Target machine: Ubuntu 14.04 ARM 32-bit (a board similar to Raspberry-Pi)

我有一个库源代码,其中包含configure.ac和Makefile.am文件.我想在主机上编译此代码,并生成可以复制到目标平台的ARM二进制文件.

I have a library source code which has configure.ac and Makefile.am files for it. I want to compile this code on host machine and generate ARM binaries which can be copied over to the target platform.

做到这一点的规范方法是什么?

What is the canonical way to do this?

具体来说,我正在寻找适用于使用arm-linux-gnueabi-gcc和自动工具交叉编译的C语言中的"Hello World"应用程序/库的东西.

For specifics, I am looking for something that would work for a "Hello World" application/library in C cross-compiled using arm-linux-gnueabi-gcc and autotools.

推荐答案

--build=`./config.guess` --host=arm-linux-gnueabi

可能就足够了,因为它将寻找相应的ARM工具链.否则,请尝试添加:CC="arm-linux-gnueabi-gcc"

might be sufficient, as it will look for a corresponding ARM toolchain. Otherwise, try adding: CC="arm-linux-gnueabi-gcc"

您还可以添加:CFLAGS="-pipe -Wall -O2 ... <other arm-gcc flags>"
以获得更好的代码优化.

You can also add: CFLAGS="-pipe -Wall -O2 ... <other arm-gcc flags>"
for better code optimization.

这篇关于如何交叉编译ARM的自动工具项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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