uboot compile error with linaro gcc

I tried build u-boot with Linaro gcc on ST STM32 board. But I got error as:

 

 

arm-linux-gnueabihf-ld.bfd: error: /home/gcc/lib/gcc/arm-linux-gnueabihf/5.1.1/libgcc.a(_lshrdi3.o): Conflicting architecture profiles A/M
arm-linux-gnueabihf-ld.bfd: failed to merge target specific data of file /home/gcc/lib/gcc/arm-linux-gnueabihf/5.1.1/libgcc.a(_lshrdi3.o)
arm-linux-gnueabihf-ld.bfd: error: /home/gcc/lib/gcc/arm-linux-gnueabihf/5.1.1/libgcc.a(_ashldi3.o): Conflicting architecture profiles A/M
arm-linux-gnueabihf-ld.bfd: failed to merge target specific data of file /home/gcc/lib/gcc/arm-linux-gnueabihf/5.1.1/libgcc.a(_ashldi3.o)
arm-linux-gnueabihf-ld.bfd: error: /home/gcc/lib/gcc/arm-linux-gnueabihf/5.1.1/libgcc.a(_aeabi_uldivmod.o): Conflicting architecture profiles A/M
arm-linux-gnueabihf-ld.bfd: failed to merge target specific data of file /home/gcc/lib/gcc/arm-linux-gnueabihf/5.1.1/libgcc.a(_aeabi_uldivmod.o)
arm-linux-gnueabihf-ld.bfd: error: /home/gcc/lib/gcc/arm-linux-gnueabihf/5.1.1/libgcc.a(_dvmd_lnx.o): Conflicting architecture profiles A/M
arm-linux-gnueabihf-ld.bfd: failed to merge target specific data of file /home/gcc/lib/gcc/arm-linux-gnueabihf/5.1.1/libgcc.a(_dvmd_lnx.o)
arm-linux-gnueabihf-ld.bfd: error: /home/gcc/lib/gcc/arm-linux-gnueabihf/5.1.1/libgcc.a(_udivmoddi4.o) uses VFP register arguments, u-boot does not
arm-linux-gnueabihf-ld.bfd: error: /home/gcc/lib/gcc/arm-linux-gnueabihf/5.1.1/libgcc.a(_udivmoddi4.o): Conflicting architecture profiles A/M
arm-linux-gnueabihf-ld.bfd: failed to merge target specific data of file /home/gcc/lib/gcc/arm-linux-gnueabihf/5.1.1/libgcc.a(_udivmoddi4.o)
make: *** [u-boot] Error 1


The first error is _lshrdi3 which is shift to right as A>>B . And it is error if the A is 64 bit variable as uint64_t and B is variable.

 

The second error is _ashldi3 which is shift to left as A<<B . And it is error if the A is 64 bit variable as uint64_t and B is variable.

The third error is _uldivmod which is divide as A/B. And it is error if A is 64 bit variable as uint64_t and B is variable. To fix this one could include div64.h and use lldiv() function.

 

The easy way to fix it is to use arm-none-eabi-gcc. arm-none-eabi-gcc has armv7-m libgcc.a.

To get arm-none-eabi-gcc, here is the link:

 

But the strange thing is the Linaro gcc libgcc.a has _lshrdi3 and _ashldi3 in thumb code. So why it fail during link? Need keep study it.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值