今天对 MP3DecodeDLL工程做了一些简单优化,然后在S60 v3平台上成功通过模拟器和GCCE编译,但是S60 v5平台上只能通过模拟器编译,然而在进行GCCE编译的时候出现以下错误:
cc1.exe: warning: command line option "-Wno-ctor-dtor-privacy" is valid for C++/
ObjC++ but not for C
{standard input}: Assembler messages:
{standard input}:122: Error: selected processor does not support `smull r2,r1,r0,r3'
{standard input}:124: Error: unshifted register required -- `adc r0,r2,r1,lsl#4'
{standard input}:362: Error: selected processor does not support `smull r2,ip,r0,r3'
{standard input}:364: Error: unshifted register required -- `adc r1,r2,ip,lsl#4'
{standard input}:526: Error: selected processor does not support `smull r1,r2,r0,r3'
{standard input}:528: Error: unshifted register required -- `adc r3,r1,r2,lsl#4'
{standard input}:923: Error: selected processor does not support `smull r1,ip,r2,r3'
{standard input}:925: Error: unshifted register required -- `adc r3,r1,ip,lsl#4'
{standard input}:1546: Error: selected processor does not support `smull r1,ip,r2,r3'
{standard input}:1548: Error: unshifted register required -- `adc r3,r1,ip,lsl#4'
{standard input}:1621: Error: selected processor does not support `smull r1,sl,r2,r3'
{standard input}:1623: Error: unshifted register required -- `adc r3,r1,sl,lsl#4
在网络上查了一些资料,如下:
For Symbian OS v9.3 and earlier versions, the build targets used to create binaries conforming to ABI v1 and ABI v2 are ARMV5 and ARMV5_ABIv2 respectively, and ARMV6 and ARMV6_ABIv2 respectively. By default, the abld build command will create binaries conforming to ARMV5 ABI v1.
For Symbian OS v9.4 and later, the build targets used to create binaries conforming to ABI v2 and ABI v1 are ARMV5 and ARMV5_ABIv1 respectively, and ARMV6 and ARMV6_ABIv1 respectively. By default, the abld build command will create binaries conforming to ARMV5 ABI v2.
既Symbian9.4以后(S60 5th),默认的指令集是ARMV5 ABI v2,之前的版本是ARMV5 ABI v1。但是我们也可以使其退回到v1。
To switch back to ABI v1 mode from ABI v2 mode, disable the ENABLE_ABIV2_MODE macro. You can disable the macro either by commenting it or removing it from the variant.cfg file.
解决方法:
打开 \epoc32\tools\compilation_config\GCCE.mk 文件,找到并用'#'注释掉 THUMB_INSTRUCTION_SET=-mthumb 这条语句,使gcc使用thumb指令的参数即可。
重新在S60 V5平台上进行GCCE编译,OK!
参考:
[1] http://discussion.forum.nokia.com/forum/showthread.php?154649-3rd%E7%A8%8B%E5%BA%8F%E5%9C%A85th%E4%B8%8B%E7%BC%96%E8%AF%91%E4%B8%8D%E6%88%90%E5%8A%9F
[2] http://www.devdiv.net/bbs/thread-15366-1-1.html