ARM: gmp has no support for thumb interworking

Richard Earnshaw Richard.Earnshaw at
Sat Nov 18 23:27:32 CET 2006

On Sat, 18 Nov 2006 00:16:26 GMT, Richard Earnshaw wrote:

>  ./configure --host=none-unknown-netbsd3.0; make; make check
> R.
> > /work/rearnsha/gnu/gmp/.libs/ undefined reference to 
> > `__gmpn_add_nc'
> > /work/rearnsha/gnu/gmp/.libs/ undefined reference to 
> > `__gmpn_sub_nc'
> > gnumake[4]: *** [t-bswap] Error 1

This is because of this test in mpn/generic/addsub_n.c

#if HAVE_NATIVE_mpn_add_nc || !HAVE_NATIVE_mpn_add_n
	  acyo = mpn_add_nc (r1p + off, s1p + off, s2p + off, this_n, acyo);
	  acyn = mpn_add_n (r1p + off, s1p + off, s2p + off, this_n);
	  acyo = acyn + mpn_add_1 (r1p + off, r1p + off, this_n, acyo);

since neither of the native functions are defined, the #if condition 
evaluates to true and we emit a call to mpn_add_nc.  But the generic code 
only provides mpn_add_n, so we end up with a link failure.

I suspect the test should just be

  #if HAVE_NATIVE_mpn_add_nc 

since we want the else branch if neither is provided as a native function.

There's a similar problem for the sub_n/sub_nc calls.


More information about the gmp-bugs mailing list