Failure when compiling for cortex-m4

Robert Baruch robert.c.baruch at
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
<>, section "Enabling
Thumb-2") to mpn/arm/arm-defs.m4:

.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
-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16
--specs=nosys.specs lshift.asm -o lshift.o

 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

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: <>

More information about the gmp-bugs mailing list