[U-Boot] tpl build error "width suffixes are invalid in ARM mode"

Dr. Philipp Tomsich philipp.tomsich at theobroma-systems.com
Wed Aug 30 08:59:11 UTC 2017


Kever,

I took a quick look and this seems to be an issue with CONFIG macros.
This is failing, because the assembly (after preprocessing) requests regular ARM mode and
supplies Thumb mnemonics (e.g. nop.w).

The trigger seems to be the following CONFIG_IS_ENABLED check in arch/arm/lib/memcpy.S:
	#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD) && !defined(MEMCPY_NO_THUMB_BUILD)
	       .thumb
 	       .thumb_func
	#endif

I checked that this compiles correctly, if I supply -DCONFIG_SPL_SYS_THUMB_BUILD on the
commandline. Works as expected.

So, you’ll just have to enable SPL_SYS_THUMB_BUILD for you configuration (see also Tom’s
commit message in commit 3a649407a49b041ceb826d55b5919dc8297f8965).

Regards,
Philipp.

> On 30 Aug 2017, at 10:33, Kever Yang <kever.yang at rock-chips.com> wrote:
> 
> Hi 
> I get build error when I try to enable TPL for a new armv7 chip, the error happen when I build arch/arm/lib/memcpy.S,
> 
> the file can pass the build for SPL but failed in TPL build, the log is here:
> 
> The build can success if I remove the '-DCONFIT_TPL_BUILD' in red, any people can help on this?
> arm-linux-gnueabihf-gcc -Wp,-MD,tpl/arch/arm/lib/.memcpy.o.d  -nostdinc -isystem /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/include -Iinclude    -I./arch/arm/include -include ./include/linux/kconfig.h -D__KERNEL__ -D__UBOOT__ -DCONFIG_SPL_BUILD -DCONFIG_TPL_BUILD -D__ASSEMBLY__ -g -DCONFIG_THUMB2_KERNEL -D__ARM__ -Wa,-mimplicit-it=always -mthumb -mthumb-interwork -mabi=aapcs-linux -mno-unaligned-access -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe -march=armv7-a -D__LINUX_ARM_ARCH__=7 -I./arch/arm/mach-rockchip/include   -c -o tpl/arch/arm/lib/memcpy.o arch/arm/lib/memcpy.S
> arch/arm/lib/memcpy.S: Assembler messages:
> arch/arm/lib/memcpy.S:114: Error: width suffixes are invalid in ARM mode -- `nop.w'
> arch/arm/lib/memcpy.S:115: Error: width suffixes are invalid in ARM mode -- `ldr.w r3,[r1],#4'
> arch/arm/lib/memcpy.S:116: Error: width suffixes are invalid in ARM mode -- `ldr.w r4,[r1],#4'
> arch/arm/lib/memcpy.S:117: Error: width suffixes are invalid in ARM mode -- `ldr.w r5,[r1],#4'
> arch/arm/lib/memcpy.S:118: Error: width suffixes are invalid in ARM mode -- `ldr.w r6,[r1],#4'
> arch/arm/lib/memcpy.S:119: Error: width suffixes are invalid in ARM mode -- `ldr.w r7,[r1],#4'
> arch/arm/lib/memcpy.S:120: Error: width suffixes are invalid in ARM mode -- `ldr.w r8,[r1],#4'
> arch/arm/lib/memcpy.S:121: Error: width suffixes are invalid in ARM mode -- `ldr.w lr,[r1],#4'
> ...
> 
> Thanks,
> - Kever



More information about the U-Boot mailing list