首页 > 解决方案 > 在源代码树中使用 MPFR 构建 GCC 仅适用于 MPFR 3.1.0+

问题描述

我已经阅读了安装 文档./contrib/download_prerequisites对我不起作用,因为我在代理后面并且无法让 wget 工作。所以我从这里拿了指针,从镜像站点下载了 GCC7.3.0 压缩包并解压缩。然后我将 MPFR、GMP、ISL 和 MPC 的压缩包放到 gcc7.3.0 srcdir中,解压缩它们并为它们中的每一个执行以下操作:

mkdir gmp
mv gmp-* gmp

然后移出这个srcdir并 cd 到另一个我运行配置的objdir 。

checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... gawk
checking for libatomic support... yes
checking for libcilkrts support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... yes
checking for libmpx support... yes
checking for libhsail-rt support... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... no
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
configure: error: Building GCC with MPFR in the source tree is only handled for MPFR 3.1.0+.

reddit wiki 说the gcc build process will automatically build gmp / mpfr / mpc / isl since you've placed them at the expected locations here.我不明白为什么会出现错误。

标签: gccbuild

解决方案


两个猜测:你要么尝试使用旧版本的 MPFR(根据contrib/download_prerequisitesGCC 7.3,你至少需要ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2)或者你'已经把它放在错误的位置(你的代码段会将 MPFR 放入$SRC/gmp/gmp-X.Y.Z,而你只需要$SRC/gmp)。


推荐阅读