Errors cross compiling GMP

paul zimmermann Paul.Zimmermann at inria.fr
Tue Oct 6 11:51:41 UTC 2015


       Hi,

this is off-topic since the error you get is not related to GMP.

Anyway, the fix is to replace mpfr_get_z_exp by mpfr_get_z_2exp in pow.c.

>From the documentation of MPFR:

   • ‘mpfr_get_z_2exp’ (added in MPFR 3.0).  This function was named
     ‘mpfr_get_z_exp’ in previous versions; ‘mpfr_get_z_exp’ is still
     available via a macro in ‘mpfr.h’:
          #define mpfr_get_z_exp mpfr_get_z_2exp
     Thus code that needs to work with both MPFR 2.x and MPFR 3.x should
     use ‘mpfr_get_z_exp’.

Paul Zimmermann

> Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gmp-discuss-bounces at gmplib.org; spf=None smtp.mailfrom=gmp-discuss-bounces at gmplib.org; spf=None smtp.helo=postmaster at smtp.gmplib.org
> From: Sri Yogesh Dorbala <yogeshdorbala at gmail.com>
> Date: Thu, 1 Oct 2015 12:49:30 +0530
> 
> I have followed this How-to
> <https://how-to-build-for-arm.wikispaces.com/gcc-4_8_2> and g,h section of
> cross compiling tutorial
> <http://pmc.polytechnique.fr/pagesperso/dc/arm-en.html> for cross compiling
> GMP. This is the error message(last part) I get after running make.
> 
> /usr/bin/ld: skipping incompatible
> /home/yogi/workbench/gcc-4.8.2/arm/lib/libmpfr.so when searching for
> -lmpfr/usr/bin/ld: skipping incompatible
> /home/yogi/workbench/gcc-4.8.2/arm/lib/libmpfr.a when searching for
> -lmpfr/usr/bin/ld: skipping incompatible
> /home/yogi/workbench/gcc-4.8.2/arm/lib/libmpfr.so when searching for
> -lmpfr/usr/bin/ld: skipping incompatible
> /home/yogi/workbench/gcc-4.8.2/arm/lib/libmpfr.a when searching for
> -lmpfr/usr/bin/ld: skipping incompatible
> /home/yogi/workbench/gcc-4.8.2/arm/lib/libgmp.a when searching for
> -lgmp/usr/bin/ld: skipping incompatible
> /home/yogi/workbench/gcc-4.8.2/arm/lib/libgmp.a when searching for
> -lgmp/home/yogi/workbench/gcc-4.8.2/xtools/build/final-gcc-cross/./mpc/src/.libs/libmpc.a(pow.o):
> In function `mpc_pow_exact':/home/yogi/workbench/gcc-4.8.2/xtools/src/gcc-4.8.2/mpc/src/pow.c:123:
> undefined reference to
> `mpfr_get_z_exp'/home/yogi/workbench/gcc-4.8.2/xtools/src/gcc-4.8.2/mpc/src/pow.c:135:
> undefined reference to
> `mpfr_get_z_exp'/home/yogi/workbench/gcc-4.8.2/xtools/src/gcc-4.8.2/mpc/src/pow.c:143:
> undefined reference to `mpfr_get_z_exp'
> collect2: error: ld returned 1 exit status
> make[2]: *** [cc1] Error 1
> make[2]: Leaving directory
> `/home/yogi/workbench/gcc-4.8.2/xtools/build/final-gcc-cross/gcc'
> make[1]: *** [all-gcc] Error 2
> make[1]: Leaving directory
> `/home/yogi/workbench/gcc-4.8.2/xtools/build/final-gcc-cross'
> 
> How to fix it?
> 
> Also, any tutorial link on cross compiling GMP to ARM would be highly
> helpful.
> 
> Thanks!
> _______________________________________________
> gmp-discuss mailing list
> gmp-discuss at gmplib.org
> https://gmplib.org/mailman/listinfo/gmp-discuss


More information about the gmp-discuss mailing list