0

I have been trying to develop static library (.a) for arm6/arm7 using C++, Eclipse and Sourcery Lite edition ARM tool-chain on Mac OS. I have successfully setup (compile/build/configured) sourcery lite toolchain for Eclipse and able to build static library for arm9 without any error. Somehow, it does not compile/build for arm6/arm7. I don't know why ? I get following compile time error: "selected processor does not support ARM mode `bx lr'" the same code works for arm9.

But when I check built static library using "lip -info" it says "lipo: archive with no architecture specification: libHelloCppLib.a (can't determine architecture for it)". Also I am unable to use that lib into my iPhone app. Can somebody help ? what could be the wrong into this ? Thank You.

4

1 回答 1

0

适用于 Linux 的 Sourcery CodeBench 支持 armv4、armv5 和 armv7。v5 设置在 v6/v7 硬件上应该可以正常工作。

如果您使用的是非 Linux 版本(“EABI”),那么您有 armv4、armv6-M 和 armv7。我不确定“v6-M”multilib 是否适合您(适用于微控制器);在这种情况下,您可能会使用 v4 做得更好。

可以指定除官方支持的架构(例如)之外-march=armv6架构,并且编译器会做正确的事情(可能),但由于它不附带为那些(libgcc.a)构建的支持库,因此必须使用它确实有(很可能是 v4),并且您可能会遇到链接错误。试试看:)

顺便说一句,如果您使用的是“Sourcery G++”,听起来您没有最新版本。几年来,它一直被称为“Sourcery CodeBench”。

于 2013-08-23T12:23:25.043 回答