Assembler failure on 16-bit ARM Thumb-1 build

Mike Mohr akihana at gmail.com
Sat Mar 19 22:39:03 CET 2011


Afternoon,

After successfully building GMP 5.0.1 for armv7a with and without
neon, I've attempted to build it for a 16-bit Thumb-1 target.  This is
needed for platform compatibility with older Android smartphones: the
package manager installs the relevant library depending on the current
architecture.  Here are the relevant bits from the environment and the
configure command:

export PATH=/tmp/android-9/bin:${PATH}
export LDFLAGS='-Wl,--fix-cortex-a8'
export CFLAGS='-O2 -mthumb'

./configure --prefix=/usr --host=arm-linux-androideabi

The configure script finishes as before, but when make is started the
build fails fairly quickly as follows:

libtool: compile:  arm-linux-androideabi-gcc -std=gnu99 -c
-DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_dive_1
-O2 -mthumb -Wa,--noexecstack dive_1.s  -fPIC -DPIC -o .libs/dive_1.o
dive_1.s: Assembler messages:
dive_1.s:73: Error: selected processor does not support `umull r8,r5,r4,r3'
dive_1.s:183: Error: selected processor does not support `umull fp,ip,r0,r3'
make[2]: *** [dive_1.lo] Error 1

Looking through the generated assembly code, the two parts that are failing are:

#APP
@ 136 "dive_1.c" 1
        umull r8,r5,r4,r3
@ 0 "" 2

#APP
@ 115 "dive_1.c" 1
        umull fp,ip,r0,r3
@ 0 "" 2

Looking on lines 115 and 136 in mpn/dive_1.c shows:

from mpn/dive_1.c on lines:
  115 - umul_ppmm (h, dummy, l, divisor);
  136 - umul_ppmm (h, dummy, l, divisor);

So it appears that umul_ppmm is unsupported on thumb-1 as-is.  I know
next to no ARM assembly, so I'm hoping that someone on this list can
help.

Thanks,
Mike


More information about the gmp-bugs mailing list