从 linux 交叉编译到 ARM-ELF (ARM926EJ-S/MT7108) [英] Cross compile from linux to ARM-ELF (ARM926EJ-S/MT7108)
问题描述
到目前为止,我已经在我的 ubuntu 系统上安装了所有交叉编译包,但我有一个问题,需要一些帮助.
I have installed all cross compile packages on my ubuntu system so far but am having a problem and need some help.
Processor : ARM926EJ-S rev 5 (v5l)
BogoMIPS : 184.72
Features : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant : 0x0
CPU part : 0x926
CPU revision : 5
Cache type : write-back
Cache clean : cp15 c7 ops
Cache lockdown : format C
Cache format : Harvard
I size : 32768
I assoc : 4
I line length : 32
I sets : 256
D size : 32768
D assoc : 4
D line length : 32
D sets : 256
Hardware : MT7108
Revision : 0000
Serial : 0000000000000000
这是我需要交叉编译的目标机器.我应该使用什么标志编译时使用?
This is the target machine I need to cross compile for. What flags should I use when compiling?
推荐答案
apt-cache search arm |grep ^gcc-
给出以下列表,
- gcc-4.7-aarch64-linux-gnu - GNU C 编译器
- gcc-4.7-arm-linux-gnueabi - GNU C 编译器
- gcc-4.7-arm-linux-gnueabi-base - GCC,GNU 编译器集合(基础包)
- gcc-4.7-arm-linux-gnueabihf - GNU C 编译器
- gcc-4.7-arm-linux-gnueabihf-base - GCC,GNU 编译器集合(基础包)
- gcc-4.7-multilib-arm-linux-gnueabi - GNU C 编译器(multilib 文件)
- gcc-4.7-multilib-arm-linux-gnueabihf - GNU C 编译器(multilib 文件)
- gcc-aarch64-linux-gnu - 用于 arm64 架构的 GNU C 编译器
- gcc-arm-linux-gnueabi - 用于 armel 架构的 GNU C 编译器
- gcc-arm-linux-gnueabihf - 用于 armhf 架构的 GNU C 编译器
您应该安装 gcc-arm-linux-gnueabi,它是 gcc-4.7-arm-linux-gnueabi 的别名.gcc-4.7-multilib-arm-linux-gnueabi 也是可能的,但更复杂.使用标志 -march=armv5te -mtune=arm926ej-s -msoft-float -mfloat-abi=soft
.您可以通过将 --param NAME=VALUE
选项指定为 gcc
并根据系统内存子系统时间调整参数来进行更多调整.
You should install gcc-arm-linux-gnueabi which is an alias for gcc-4.7-arm-linux-gnueabi. gcc-4.7-multilib-arm-linux-gnueabi is also possible, but more complicated. Use the flags, -march=armv5te -mtune=arm926ej-s -msoft-float -mfloat-abi=soft
. You can do more tuning by specifying the --param NAME=VALUE
option to gcc
with parameters tuned to your systems memory sub-system timing.
您可能无法使用这些 gcc
版本,因为您的 Linux 可能使用 OABI 编译和/或与编译器是为之构建的.在某些情况下,libc 会调用较新的 Linux API,而后者可能不存在.如果未将编译器/libc 配置为向后兼容,则它可能不适用于您的系统.您可以使用 crosstool-ng 来创建适合您系统的自定义编译器,但这远不止这些复杂.
You may not be able to use these gcc
versions as your Linux maybe compiled with OABI and/or be quite ancient compared to the one the compiler was built for. In some cases, the libc will call a newer Linux API, which may not be present. If the compiler/libc was not configured to be backwards compatible, then it may not work with your system. You can use crosstool-ng to create a custom compiler that is built to suit your system, but this is much more complex.
这篇关于从 linux 交叉编译到 ARM-ELF (ARM926EJ-S/MT7108)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!