1.环境:Linux xxx 2.6.18-371.3.1.el5xen #1 SMP Mon Nov 11 03:28:23 EST 2013 x86_64 x86_64 x86_64 GNU/Linuxjava
2.下载linux
gcc4.8包 gmp包、mpfr包、mpc包(都要安装)c++
(../configure --prefix=/home/mawanli/work/gcc482 --mandir=/home/mawanli/work/gcc482/man --infodir=/home/mawanli/work/gcc482/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++ --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --build=x86_64-redhat-linux --with-gmp=/home/mawanli/soft/gcc-4.8.2/work/gmpwork/ --with-mpfr=/home/mawanli/soft/gcc-4.8.2/work/mpfrwork/ --with-mpc=/home/mawanli/soft/gcc-4.8.2/work/mpcwork/)app
3.安装出现问题jvm
3.1 configure: error: cannot compute suffix of object files: cannot compileui
解决:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{$gmppath}/lib:{$mpfrpath}/lib:{$mpcpath}/lib线程
3.2 x86_64-redhat-linux-ar: Command not foundcode
解决 --host=x86_64-redhat-linux改成--build=x86_64-redhat-linuxget
3.3 gcc GNAT is required to build adait
解决 configure时--enable-languages=c,c++,(ada去掉)
3.4 configure-fixincludes错误 1
make disclean (不太好使)
把gcc下东西所有删除 从新编译
4. make是用 (make -j 8)快
~/work/gcc482/bin/gcc -v 使用内建 specs。 COLLECT_GCC=/home/mawanli/work/gcc482/bin/gcc COLLECT_LTO_WRAPPER=/home/mawanli/work/gcc482/libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper 目标:x86_64-redhat-linux 配置为:../configure --prefix=/home/mawanli/work/gcc482 --mandir=/home/mawanli/work/gcc482/man --infodir=/home/mawanli/work/gcc482/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++ --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --build=x86_64-redhat-linux --with-gmp=/home/mawanli/soft/gcc-4.8.2/work/gmpwork/ --with-mpfr=/home/mawanli/soft/gcc-4.8.2/work/mpfrwork/ --with-mpc=/home/mawanli/soft/gcc-4.8.2/work/mpcwork/ 线程模型:posix gcc 版本 4.8.2 (GCC)
4.1 error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory
解决:加环境变量里面
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/mawanli/soft/gcc-4.8.2/work/gmpwork/lib:/home/mawanli/soft/gcc-4.8.2/work/mpcwork/lib:/home/mawanli/soft/gcc-4.8.2/work/mpfrwork/lib
总结:这个耗费我大把时间 不过干完以后跑起来真的开心(中途我有放弃不玩了,可是仍是作完啦)