android平台GMP库配置错误.处理步骤

Configuration error of the GMP library for the android platform

本文关键字:处理 错误 配置 平台 GMP android      更新时间:2023-10-16

我正试图为android (arm)编译GMP,但我收到了一个非常奇怪的错误。首先,我设置了一些东西来描述另一个SO问题:

    export NDKROOT=/prod/ndk
    $NDKROOT/build/tools/make-standalone-toolchain.sh --platform=android-9 --  install-dir=$NDKROOT/android_armeabi   
    export CC="$NDKROOT/android_armeabi/bin/arm-linux-androideabi-gcc --sysroot=$NDKROOT/android_armeabi/sysroot"
    export CXX="$NDKROOT/android_armeabi/bin/arm-linux-androideabi-g++ --sysroot=$NDKROOT/android_armeabi/sysroot"
    export AR="$NDKROOT/android_armeabi/bin/arm-linux-androideabi-ar"
    export SYSROOT="$NDKROOT/android_armeabi/sysroot"
    export PATH="$NDKROOT/android_armeabi/bin":$PATH

然后我简单地运行./configure --enable-cxx --prefix=/local/to/where/i/want/to/install --host=arm-none-linux-gnueabi,配置正常,输出如下:

      Version:           GNU MP 5.1.1
      Host type:         arm-none-linux-gnueabi
      ABI:               standard
      Install prefix:    /location/to/where/i/want/to/install
      Compiler:          /prod/ndk/android_armeabi/bin/arm-linux-androideabi-gcc --   sysroot=/prod/ndk/android_armeabi/sysroot -std=gnu99
      Static libraries:  yes
      Shared libraries:  yes

到这里一切正常,但是当我运行make时,我收到以下错误:

    ismpf.cc: In function 'std::istream& operator>>(std::istream&, mpf_ptr)':
    ismpf.cc:48:43: error: 'struct lconv' has no member named 'decimal_point'
    make[2]: *** [ismpf.lo] Error 1
    make[2]: Leaving directory `~/Downloads/gmp-5.1.1/cxx'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `~/Downloads/gmp-5.1.1'
    make: *** [all] Error 2

我的第一个问题在这里。什么好主意吗?

只是出于好奇,我试图重新运行与上面相同的配置命令,但使用sudo在它之前。几秒钟后,我收到以下信息:

    configure: error: Oops, mp_limb_t is 64 bits, but the assembler code
    in this configuration expects 32 bits.

出现了第二个(也是非常奇怪的问题)。

出于好奇,我再次尝试重新启动并清除我们创建的所有变量,并简单地运行GMP手册建议的命令:./configure——prefix=/location/——enable-cxx——host=arm-linux-androideabi

./configure运行,make运行正常,但是当我执行make check时,所有9/9测试都失败了。有人能指出我在正确的方向与这些错误,或关于如何尝试和正确编译GMP为android?任何帮助都是非常感激的。

取消CFLAGS的env变量为我解决了这个问题。