ARM 的 Clang 交叉编译? [英] Clang Cross Compiling for ARM?
问题描述
是否可以为 ARM 处理器设置 Clang 进行交叉编译?主机可能在 x86 上(AMD64 - 可能是 Ubuntu 12.04),目标是 ARM(Raspberry Pi 和 Pandaboard - 将为每个做单独的编译),我可能在某个时候也希望为 PowerPC 架构交叉编译?程序源代码为 C.
Is it possible to set up Clang for cross compiling for the ARM processor? The host will likely be on x86 ( AMD64 - Probably Ubuntu 12.04 ) and the target would be ARM ( Raspberry Pi as well as Pandaboard - will do separate compilations for each ), I may at some point also wish to cross compile for the PowerPC architecture? The program source is in C.
推荐答案
为运行 soft-float Linux 发行版的 Raspberry Pi 交叉编译添加标志 -ccc-host-triple arm-eabi -marm -mfpu=vfp-mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=softfp
To cross-compile for Raspberry Pi running soft-float Linux distros add flags -ccc-host-triple arm-eabi -marm -mfpu=vfp -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=softfp
要为运行硬浮动 Linux 发行版的 Raspberry Pi 进行交叉编译,请使用标志 -ccc-host-triple arm-eabi -marm -mfpu=vfp -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard
To cross-compile for Raspberry Pi running hard-float Linux distros use the flags -ccc-host-triple arm-eabi -marm -mfpu=vfp -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfloat-abi=hard
要交叉编译 Pandaboard 使用标志 -ccc-host-triple arm-eabiv7 -mthumb -mfpu=neon-fp16 -mcpu=cortex-a9 -mtune=cortex-a9 -mfloat-abi=hard
(假设你的 Pandaboard 运行 Ubuntu)
To cross-compile for Pandaboard use flags -ccc-host-triple arm-eabiv7 -mthumb -mfpu=neon-fp16 -mcpu=cortex-a9 -mtune=cortex-a9 -mfloat-abi=hard
(assuming that your Pandaboard runs Ubuntu)
注意:最近的 clang
版本使用 -target
选项而不是 -ccc-host-triple
Note: more recent clang
version use -target
option instead of -ccc-host-triple
这篇关于ARM 的 Clang 交叉编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!