我知道,编译编译器是一个讽刺。但是我需要这个编译器的特定版本,而CentOS 5.x版本库没有最新版本的GCC。编译编译器错误编译GCC
我需要的版本是4.3.2,但我只有4.1.1。
我跟着这个教程安装在gcc http://www.mjmwired.net/resources/mjm-fedora-gcc.html和我用下面的参数在配置(前编译):
/root/gcc/gcc-4.3.6/configure前缀= /选择/ gcc43 --program-suffix = 43 --enable-languages = c,C++ --enable-shared --enable-threads = posix --disable-checking --with-system-zlib --enable -__ cxa_atexit --disable -libunwind的例外 - 禁用multilib的
最后一个选项--disable-multilib
救救我的另一个错误是我在以前的编译尝试了(很长的时间编译之后。 ..)
我设立一个环境变量,因为在以前的尝试,我有错误,所以我设置如下:
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib:$LD_LIBRARY_PATH
,以确保编译器搜索MPFR和GMP库(需要哪些)在该目录中
所以,我执行'make'命令。
我虽然是一切就OK了,因为这个时候只花了更多的时间(在我的最后一次尝试设置变量之前我花了约2小时编译)
我用Amazon Web Services的微实例,该实例有1个单核x86_64处理器和613 MB的RAM,,所以编译需要大约9个小时。
偏偏我又得到了错误的!现在我得到这样的:
make[2]: Entering directory `/root/gcc/build'
make[3]: Entering directory `/root/gcc/build'
rm -f stage_current
make[3]: Leaving directory `/root/gcc/build'
Comparing stages 2 and 3
warning: ./cc1-checksum.o differs
warning: ./cc1plus-checksum.o differs
Bootstrap comparison failure!
./gcc.o differs
./varasm.o differs
./except.o differs
./i386.o differs
make[2]: *** [compare] Error 1
make[2]: Leaving directory `/root/gcc/build'
make[1]: *** [stage3-bubble] Error 2
make[1]: Leaving directory `/root/gcc/build'
make: *** [all] Error 2
有什么建议?
“我知道,编译一个编译器是一个讽刺。”技术术语是* bootstrapping *而不是讽刺。 – thiton 2011-12-28 13:16:08