Unable to build static library for arm6/arm7 using sourcery lite edition toolchain, C++, Eclipse on Mac OS?

570 views Asked by At

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.

1

There are 1 answers

10
ams On

Sourcery CodeBench for Linux supports armv4, armv5, and armv7. The v5 setting should work fine on v6/v7 hardware.

If you're using the non-linux version ("EABI") then you have armv4, armv6-M, and armv7. I'm not sure the "v6-M" multilib is right for you (it's for microcontrollers); in that case you might do better with v4.

It is possible to specify architectures other than those officially supported (e.g. -march=armv6), and the compiler will do the right thing (probably), but as it doesn't come with support libraries built for those (libgcc.a) it'll have to use one it does have (most likely the v4 one), and you may get link errors. Try it and see :)

BTW, if you're using "Sourcery G++", it doesn't sound like you have the latest version. It's been called "Sourcery CodeBench" for a couple of years now.