如何升级Carbide C++的GCCE Tool Chain

 

Carbide C++的编译器

在Symbian开发工程中,Carbide C++是非常好用的开发工具,目前提供GCCE,ARMV5和RVCT三种编译器的支持。前两种编译器是免费的,RVCT是收费的编译工具,网上下载的Carbide并不默认提供,需要自己下载并配置才能使用,由于RVCT提供了专门的优化,编译结果的目标文件体积很小,且代码执行效率更高,但问题是该编译器费用比较昂贵,普通开发者很难承担。

目前,开发者中使用GCCE的比较多,但使用GCCE的问题是,默认提供的GCCE的版本比较老,在C:\Program Files\CSL Arm Toolchain\arm-none-symbianelf\bin\gcc -v可以看到,默认的GCC版本是2005年Release的3.4.3。在Codesourcery的网站上可以看到,目前最新的版本是2008年Q3Release的4.3.2版本。经过升级GCCE 4编译器发现,改进如下: 1. 编译速度显著提高,即使是第一次编译也能很快完成,可以节省开发者时间。 2. 生成的目标文件体积减小,根据不同项目,结果不太相同,大部分Sis文件可以缩小40%以上的大小。 3. 应该还有些代码和信息的优化吧,不明显。 4. 更严格的代码检查,理论上讲可以提高代码的质量。

升级GCCE编译器

相信上面4点足以让大家下决心升级GCCE编译器的版本了,但是终归没有免费的午餐,GCCE工具链是免费的,所以Codesourcery并不提供任何技术支持和保证。 下面说下升级过程: 0. 环境 由于Carbide开发环境的版本不同,升级过程可能略有不同,请仔细理解下列安装步骤,我的环境是: Windows XP SP3 Carbide C++ 1.3.2 应该是网上升级后最新的Patch S60_3rd_FP2_SDK 官方用的是S60_3rd_MR_SDK, 我测试了下载FP2上也没什么问题。 请备份所有需要修改的文件,以便能够恢复到原来的环境。

1. 首先从Codesourcery的网站上下载最新版编译器的安装文件并默认安装: http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite

选择SymbianOS Sourcery G++ Lite Edition,选IA32 Windows Installer。

2. 安装完成后,替换3.4.3版本的编译器为新安装的4.3.2版本的编译器: 首先备份C:\Program Files\CSL Arm Toolchain\下的所有文件和文件夹(后面还会用到),并删除该文件夹下所有文件和文件夹,拷贝C:\Program Files\CodeSourcery\Sourcery G++ Lite\下的所有文件到C:\Program Files\CSL Arm Toolchain\

3. 给SDK打补丁 在$(EPOCROOT)Epoc32\tools\目录下的部分脚本文件由于直接使用了版本号等信息,需要手动更新到新的版本号,即从3.4.3升级到4.3.2。 在S60_3rd_FP2_SDK中,需要更改下面的文件:

cl_bpabil.pm

在S60_3rd_MR_SDK中,需要更改下面的文件:

cl_bpabi.pm
cl_gcce.pm
ide_cw.pm
compilation_config/gcce.mk

建议可以使用类似notepad++类的文本处理工具,搜索整个$(EPOCROOT)Epoc32\tools\目录及子目录内的包含版本号信息的内容,进行修改。

4. 移除GCC4中不允许的断言和冲突 在$(EPOCROOT)Epoc32\include\d32locd.h中注释掉下列断言:

__ASSERT_COMPILE(_FOFF(TLocalDriveCaps,iSize)%8 == 0);
__ASSERT_COMPILE(_FOFF(TLocalDriveCapsV3,iFormatInfo.iCapacity) % 8 == 0);

在$(EPOCROOT)Epoc32\include\gcce\gcce.h中注释掉下列声明:

typedef struct __va_list { void *__ap; } va_list;
#define va_start(ap, parmN) __builtin_va_start(ap.__ap, parmN)
#define va_arg(ap, type) __builtin_va_arg(ap.__ap, type)
#define va_end(ap) __builtin_va_end(ap.__ap)

并在相同位置添加下列代码行:

#include <libc/stdarg.h>

由于这个改动,指向标准C库中的stdarg.h所以需要在每个项目的MMP文件中添加一个路径:

SYSTEMINCLUDE \epoc32\include\libc

5. 移除SDK头文件中多余的修饰符 升级过编译器后,会出现很多类似错误信息如下:

error: extra qualification 'CAknVolumeControl::' on member 'ScaledValue'[/S60/devices/S60_3rd_FP2_SDK/epoc32/include/aknvolumecontrol.h]

找到相关的头文件,去除相应的部分即可,如:

TInt CAknVolumeControl::ScaledValue() const;//Original
TInt ScaledValue() const;//Modified

6. 4.3.2工具中 libsupc++.a的问题 在4.3.2的Release中,libsupc++.a(7kB)中缺少了一个_Unwind_GetTextRelBase的引用,这会导致在连接的过程中失败,将3.4.3中的libsupc++.a(15kB)替换即可。

7. 对于整除的问题 由于在Symbian的SDK中遗漏了__aeabi__uidiv和__aeabi_idiv,所以在整除的时候会出现编译错误,解决方法是自己制作一个新的文件放在每个项目中的src/目录下,例如可以命名为division.c,文件内容为:

// This code was suggested by Julian Brown from CodeSourcery. It is in public domain.
// Many thanks!

#if __GCCE__ 
#if __SERIES60_30__
extern unsigned int __aeabi_uidivmod(unsigned numerator, unsigned denominator);
int __aeabi_idiv(int numerator, int denominator) 
   {
   int neg_result = (numerator ^ denominator) & 0x80000000;
   int result = __aeabi_uidivmod ((numerator < 0) ? -numerator : numerator, (denominator < 0) ? -denominator : denominator);
   return neg_result ? -result : result;
   }
unsigned __aeabi_uidiv(unsigned numerator, unsigned denominator) 
   {
   return __aeabi_uidivmod (numerator, denominator);
   }
#endif // __SERIES60_30__
#endif // __GCCE__

此文件编译的时候会被自动加入来解决整除的问题。

最后,编译成功,查看一下你编出来的SIS文件小了多少,你应该能明显感觉到编译速度变快了,文件下载到真机上的速度也变快了(因为体积变小了)。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
n the present research, a hybrid laser polishing technology combining pulsed laser and continuous wave laser was applied to polish the surface of laser directed energy deposition (LDED) Inconel 718 superalloy components. The surface morphology, microstructure evolution and microhardness of the as-fabricated, the single pulsed laser polishing (SPLP) and the hybrid laser polishing (HLP) processed samples were investigated. The results revealed that the as-fabricated sample has a rough surface with sintered powders. In the matrix, the NbC carbide and Cr2Nb based Laves phase array parallel to the build direction and the small γʺ-Ni3Nb particles precipitate in matrix uniformly. The surface roughness of the as-fabricated sample is 15.75 μm which is decreased to 6.14 μm and 0.23 μm by SPLP and HLP processing, respectively. The SPLP processing refines the grains and secondary phase significantly in the remelted layer which is reconstructured with the cellular structure and plenty of substructures. The HLP processing also refines the grain and secondary phase but the secondary phases still exhibit array distribution. In addition, the tangled dislocations pile up along the interface of secondary phases. Compared with the as-fabricated sample, the SPLP processing decreases the surface microhardness but the HLP processing increases the surface microhardness, and the Young's elasticity modulus of surface layer is improved by SPLP and HLP processing to 282 ± 5.21 GPa and 304 ± 5.57 GPa, respectively. 翻译
最新发布
07-25

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值