aliyun / iotkit-embedded

高速镜像: https://code.aliyun.com/linkkit/c-sdk
Apache License 2.0
496 stars 252 forks source link

ARMCC 编译SDK #101

Open lingyun0129 opened 5 years ago

lingyun0129 commented 5 years ago

因GNU编译工具编译的SDK,在mtk平台出现链接错误。故想问能否用armcc来编译SDK?该如何操作,能否给予指导?

edwardyangx commented 5 years ago

可以尝试关闭编译选项 -Os 之后再重新链接

pansila commented 5 years ago

什么链接错误,我可以用MDK链接GCC编出来的库,注意选择正确的CFLAGS,比如-fshort-wchar,-mthumb,-mfloat-abi,另外一些newlib的libc库函数底层调用需要自己封装,改用mircolib的或者自己实现。

zyh2591 commented 5 years ago

请问楼上采用的是arm-none-eabi-gcc还是GNU Make + gcc 编译链接到MDK。有没有什么指导的网站或者文档分享一下,很困惑

superdsp commented 5 years ago

请问用MDK5 ARM Complier来链接 SDK, 使用arm-none-eabi-gcc 编译出的库文件 imageimage 链接后出问题, T407_SOM\T407_SOM.axf: Error: L6242E: Cannot link object sdk-impl.o as its attributes are incompatible with the image attributes. ... wchart-16 clashes with wchart-32. T407_SOM\T407_SOM.axf: Error: L6242E: Cannot link object mqtt_client.o as its attributes are incompatible with the image attributes. ... wchart-16 clashes with wchart-32. T407_SOM\T407_SOM.axf: Error: L6242E: Cannot link object mem_stats.o as its attributes are incompatible with the image attributes. ... wchart-16 clashes with wchart-32. 请问大家有办法解决么?

superdsp commented 5 years ago

T407_SOM\T407_SOM.axf: Error: L6366E: sdk-impl.o attributes are not compatible with the provided attributes . Object sdk-impl.o contains Build Attributes that are incompatible with the provided attributes. Tag_FP_arch = VFPv2 instructions were permitted (implies VFPv1 instructions were permitted) (=2) Tag_ABI_HardFP_use = Permitted VFP use is implied by Tag_FP_arch (=0) Tag_FP_HP_extension = Use of the optional half-precision extension to VFPv3/Advanced SIMDv1 was permitted (=1) 还有一堆的问题

pansila commented 5 years ago

@zyh2591 arm-none-eabi-gcc参照sdk里面提供的几个config改下就行了

pansila commented 5 years ago

@superdsp 1. 宽字符问题,要给gcc指定宽字符的大小,-fshort-wchar。2. cpu构架要匹配,在config里面指定。

另附上我遇到的问题做的patch。 board.zip