mp_limb_t is 64 bits編譯問題解決方案

場景

        華爲ARM架構服務器升級docker容器的CentOS Linux release 7.9.2009 (AltArch)版本中GCC更新到4.8支持C++11的特性。編譯gmp-4.3.2,出現如下問題:

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

第一次編譯出錯提示:

UNAME_VERSION = #31-Ubuntu SMP Tue Jul 17 15:41:03 UTC 2018
configure: error: cannot guess build type; you must specify one

通過指定[root@atlas800 gmp-4.3.2]# ./configure --prefix=/usr/local/gmp-4.3.2  --build=arm-linux 解決問題


解決過程

                升級automake-1.16版本,下載wget https://ftp.gnu.org/gnu/automake/automake-1.16.tar.gz

 配置出錯

perl: warning: Falling back to the standard locale ("C").
help2man: can't get `--help' info from automake-1.16
Try `--no-discard-stderr' if option outputs to stderr
make: *** [doc/automake-1.16.1] Error 2


 解決方案

            修改vi Makefile文件,在3694行最後添加--no-discard-stderr

修改結果如下:

   3691 doc/aclocal-$(APIVERSION).1: $(aclocal_script) lib/Automake/Config.pm
   3692         $(update_mans) aclocal-$(APIVERSION)
   3693 doc/automake-$(APIVERSION).1: $(automake_script) lib/Automake/Config.pm
   3694         $(update_mans) automake-$(APIVERSION) --no-discard-stderr


make && make install  編譯通過


經過升級automake之後,不再需要指定build類型,並且編譯通過

最終編譯gmp的指令提供如下:

./configure --prefix=/usr/local/gmp-4.3.2

make 

make install

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章