我研究用C语言编写的软件,该软件运行在具有不同体系结构的各种ARM处理器上(主要是ARMv5,ARMv6)。我们目前使用几个不同版本的RVDS编译我们的代码,但我们正在考虑使用LLVM编译一些代码以添加一些自定义工具。
我知道LLVM有ARM和Thumb目标,但它支持哪些架构? LLVM生成的代码是否可以在ARMv5上运行?我应该注意哪些限制?
答案 0 :(得分:7)
他们的source code列出了以下拱门:
// ARM architectures.
def ArchV4T : SubtargetFeature<"v4t", "ARMArchVersion", "V4T", "ARM v4T">;
def ArchV5T : SubtargetFeature<"v5t", "ARMArchVersion", "V5T", "ARM v5T">;
def ArchV5TE : SubtargetFeature<"v5te", "ARMArchVersion", "V5TE", "ARM v5TE, v5TEj, v5TExp">;
def ArchV6 : SubtargetFeature<"v6", "ARMArchVersion", "V6", "ARM v6">;
def ArchV6M : SubtargetFeature<"v6m", "ARMArchVersion", "V6M", "ARM v6m", [FeatureNoARM, FeatureDB]>;
def ArchV6T2 : SubtargetFeature<"v6t2", "ARMArchVersion", "V6T2", "ARM v6t2", [FeatureThumb2]>;
def ArchV7A : SubtargetFeature<"v7a", "ARMArchVersion", "V7A", "ARM v7A", [FeatureThumb2, FeatureNEON, FeatureDB]>;
def ArchV7M : SubtargetFeature<"v7m", "ARMArchVersion", "V7M", "ARM v7M", [FeatureThumb2, FeatureNoARM, FeatureDB, FeatureHWDiv]>;
答案 1 :(得分:1)
我已经在ARMv4和ARMv6上运行llvm生成的代码。我有一些ARMv5平台,但不记得我是否在那里尝试过。我假设泛型-march = arm的输出会给出最小公分母(ARMv4)代码,这意味着它将在ARMv5上运行。这都是嵌入式的,没有操作系统类型的工作提醒你,我没有使用llvm来创建arm linux二进制文件或类似的东西。