升级 gcc 出错排查

gcc 的安装过程大概是

1. 下载

2. 解压

3. 创建新目录, 进入创建新目录, 执行 解压后gcc 目录的 configure


这里,列出我遇到的升级过程过的错误消息,及我所使用的解决方法

1. 执行 ../gcc-5.3/configure 出现的错误

configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations.  Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
http://gcc.gnu.org/install/prerequisites.html for additional info.  If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files.  They may be located in separate packages.

解决方法:

确认 gmp, mpfr, mpc 包已经安装,并且版本正确
# rpm -qa | grep gmp
# rpm -qa | grep mpfr
# rpm -qa | grep mpc

由于 mpc 在机器上没有安装,造成这个错误.下载 mpc 的 tar 包安装
下载地址: http://www.multiprecision.org/index.php?prog=mpc&page=download
这里选择 0.8.1 的安装.最新的包会依赖其它包.
安装过程大体(./configure && make && make install)

2. 解决问题1 后,继续执行 ../gcc-5.3/configure 出现如下错误消息

/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure: error: I suspect your system does not have 32-bit developement libraries (libc and headers). If you have them, rerun configure with --enable-multilib. If you do not have them, and want to build a 64-bit-only compiler, rerun configure with --disable-multilib.

解决方法:

# ../gcc-5.3.0/configure --disable-multilib
使用选项 --disable-multilib

3. 继续执行 ../gcc-5.3/configure 又出现如下错误消息

configure: error: error verifying int64_t uses long long
make[2]: *** [configure-stage1-gcc] Error 1
make[2]: Leaving directory `/tmp/gcc_build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/tmp/gcc_build'
make: *** [all] Error 2

解决方法:

安装 gcc-c++ 包


  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值