ancient ARM cpus

Martin Husemann martin at
Sun Nov 15 10:42:28 UTC 2015

On Sun, Nov 15, 2015 at 08:01:01AM +0100, Niels Möller wrote:
> Where and how do you set ARM_THUMB_MODE? If I understand these things
> correctly, the right check is not whether or not gmp is compiled in
> thumb mode, but whether or not it's going to run on a machine where
> thumb code might call it. Which I guess needs a configure option, since
> it is difficult for configure to guess correctly and automatically.

Oops, indeed, that was not in the patches (and I am not sure we handle
it correctly internally, will have to investigate.)

> What's the corresponding gcc flag to avoid using bx in compiler
> generated code?

If we can get at the gcc defines easily for the m4 stuff, it probably would
be better to use


which seems to be present if the target cpu supports thumb mode.

You can see it with most arm compilers by doing something like:

arm--netbsdelf-eabi-gcc -mcpu=strongarm110 -dM -E - < /dev/null | fgrep THUMB

which ends up empty, and w/o the -mcpu=strongarm110 you get

#define __ARM_ARCH_ISA_THUMB 1


More information about the gmp-bugs mailing list