Failure when compiling for cortex-m4

Robert Baruch robert.c.baruch at gmail.com
Thu Mar 24 21:04:37 UTC 2016


I was able to get past this error by adding some necessary assembler
directives (see ARM/Thumb2PortingHowto
<https://wiki.ubuntu.com/ARM/Thumb2PortingHowto>, section "Enabling
Thumb-2") to mpn/arm/arm-defs.m4:

define(`ASM_START',`
.syntax unified
.code 16
')

I'm not familiar enough with the build system to suggest a patch, though.

The next error is:

/bin/bash ../libtool --mode=compile --tag=CC ../mpn/m4-ccas --m4="m4"
arm-none-eabi-gcc -std=gnu99 -c -DHAVE_CONFIG_H -I. -I..
 -D__GMP_WITHIN_GMP -I.. -DOPERATION_`echo lshift | sed 's/_$//'`
-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16
--specs=nosys.specs  `test -f 'lshift.asm' || echo './'`lshift.asm

libtool: compile:  ../mpn/m4-ccas --m4=m4 arm-none-eabi-gcc -std=gnu99 -c
-DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_lshift
-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16
--specs=nosys.specs lshift.asm -o lshift.o

m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_lshift lshift.asm
>tmp-lshift.s
 arm-none-eabi-gcc -std=gnu99 -c -DHAVE_CONFIG_H -I. -I..
-D__GMP_WITHIN_GMP -I.. -DOPERATION_lshift -mcpu=cortex-m4 -mthumb
-mfloat-abi=hard -mfpu=fpv4-sp-d16 --specs=nosys.specs tmp-lshift.s -o
lshift.o

tmp-lshift.s: Assembler messages:
tmp-lshift.s:86: Error: shift must be constant -- `orr r7,r7,r6,lsr r12'
tmp-lshift.s:90: Error: shift must be constant -- `orr r7,r7,r8,lsr r12'
tmp-lshift.s:96: Error: shift must be constant -- `orr r7,r7,r6,lsr r12'
Makefile:768: recipe for target 'lshift.lo' failed
make[2]: *** [lshift.lo] Error 1
make[2]: Leaving directory '/media/sf_robuntu-shared/gmp-6.1.0/mpn'
Makefile:954: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/media/sf_robuntu-shared/gmp-6.1.0'
Makefile:773: recipe for target 'all' failed
make: *** [all] Error 2

(tmp-lshift.s attached)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmp-lshift.s
Type: application/octet-stream
Size: 840 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-bugs/attachments/20160324/5e81d0c3/attachment.obj>


More information about the gmp-bugs mailing list