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.