centos7安装gcc4.5.1

资源链接:

https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-4.5.1/gcc-4.5.1.tar.bz2

依赖:(4.5.1依赖需要手动下载编译)

https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz

https://www.multiprecision.org/downloads/mpc-1.2.1.tar.gz

https://www.mpfr.org/mpfr-current/mpfr-4.2.0.tar.xz

安装gmp

tar xvf gmp-6.2.1.tar.xz

./configure --prefix=/opt/gcclib/gmp

make -j && make install

安装mpfr

tar xvf  mpfr-4.2.0.tar.xz

./configure --prefix=/opt/gcclib/mpfr --with-gmp-include=/opt/gcclib/gmp/include --with-gmp-lib=/opt/gcclib/gmp/lib

make -j

make check

make install

 安装mpc

tar xvf  mpc-1.2.1.tar.gz

./configure --prefix=/opt/gcclib/mpc --with-gmp-include=/opt/gcclib/gmp/include --with-gmp-lib=/opt/gcclib/gmp/lib --with-mpfr=/opt/gcclib/mpfr

make -j && make install

 gcc4.5.1安装

tar xvf gcc-4.5.1.tar.gz
export LD_LIBRARY_PATH=/opt/gcclib/gmp/lib:/opt/gcclib/mpfr/lib:/opt/gcclib/mpc/lib:$LD_LIBRARY_PATH

./configure --prefix=/opt/gcc4.5.1 --disable-multilib --with-gmp=/opt/gcclib/gmp --with-mpc=/opt/gcclib/mpc --with-mpfr=/opt/gcclib/mpfr

make -j

make install

报错1:undefined reference to `__cxa_call_unexpected

解决方法:

如下解决方法也是在google上找到的,附上原链接  50888 – Bootstrap failure in libjava against latest git glibchttp://gcc.gnu.org/bugzilla/show_bug.cgi?id=50888

主要就是替换掉/gcc-4.5.0/libjava目录下的prims.cc文件,用于替换的文件可以在这里下载

下载链接:https://gcc.gnu.org/git?p=gcc.git;a=blob_plain;f=libjava/prims.cc;hb=b33ddba240f10fbabd5e8ce12bb95038f0650886

下载文件重命名为prims.cc

报错2:/usr/include/gnu/stubs.h:7:27: 致命错误:gnu/stubs-32.h:没有那个文件或目录

yum install glibc-devel.i686 libstdc++-devel.i686

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值