解包:tar -xjf gcc-4.1.2.tar.bz2linux
進入目錄:cd gcc-4.1.2centos
# ./configure && makeoop
接着就出現錯誤ui
WARNING: `makeinfo' is missing on your system. You should only need it if you modified a `.texi' or `.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy `make' (AIX, DU, IRIX). You might want to install the `Texinfo' package or the `GNU make' package. Grab either from any GNU archive site. make[3]: *** [fastjar.info] 錯誤 1 make[3]:正在離開目錄 `/home/ssm/gcc-obj/fastjar' make[2]: *** [all] 錯誤 2 make[2]:正在離開目錄 `/home/ssm/gcc-obj/fastjar' make[1]: *** [all-fastjar] 錯誤 2 make[1]:正在離開目錄 `/home/ssm/gcc-obj' make: *** [all] 錯誤 2
(主要緣由是GCC的版本太高)線程
出現此錯誤的緣由也在於configure文件中texinfo對該版本不支持,能夠在解壓gcc4.1.2文件夾中的configure文件裏找到code
如下語句hadoop
# For an installed makeinfo, we require it to be from texinfo 4.2 or
# higher, else we use the 「missing」 dummy.
if ${MAKEINFO} –version \
| egrep ‘texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])’ >/dev/null 2>&1; then
:
else
MAKEINFO=」$MISSING makeinfo」
fi
;;get
其中4\.[2-9]|[5-9]表示的是支持4.2-4.9之間的幾個版本,因此須要本身添加4\.[1-9][0-9]*,以支持4.1.2版本。即把’texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])’編輯成’texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|4\.[1-9][0-9]*|[5-9])’後保存,編譯源碼
接着又報錯:it
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h:
參考:http://stackoverflow.com/questions/7412548/gnu-stubs-32-h-no-such-file-or-directory
On Ubuntu it's called libc6-dev-i386 - do sudo apt-get install libc6-dev-i386
. See below for extra instructions for Ubuntu 12.04.
On Red Hat distros, the package name is glibc-devel.i686
(Thanks to David Gardner's comment)
On CentOS 5.8, the package name is glibc-devel.i386
(Thanks to JimKleck's comment)
On CentOS 6.3, the package name is glibc-devel.i686
.
On SLES it's called glibc-devel-32bit - do zypper in glibc-devel-32bit
so, yum install glibc-devel.i686
繼續編譯 make
而後 make install
最後, 重啓 ,便可(當時覺得失敗了,結果次日打開時,亮瞎了雙眼,尼瑪)
[hadoop@luxury ~]$ gcc -v使用內建 specs。目標:x86_64-unknown-linux-gnu配置爲:./configure線程模型:posixgcc 版本 4.1.2