是否可以将Clang设置为用于ARM处理器的交叉编译?主机可能在x86(AMD64-可能是Ubuntu 12.04)上,目标将是ARM(Raspberry Pi和Pandaboard-会对每个文件进行单独的编译),我可能在某个时候还希望针对PowerPC架构进行交叉编译?程序源在C中。
最佳答案
要为运行软 float Linux发行版的Raspberry Pi进行交叉编译,请添加标志-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
标志
要为Pandaboard交叉编译,请使用标志-ccc-host-triple arm-eabiv7 -mthumb -mfpu=neon-fp16 -mcpu=cortex-a9 -mtune=cortex-a9 -mfloat-abi=hard
(假设您的Pandaboard运行Ubuntu)
注意:较新的clang
版本使用-target
选项代替-ccc-host-triple
关于c - 用于ARM的Clang交叉编译?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14697614/