资源链接:
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 glibc
http://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