為什麼這篇linux gcc安裝鄉民發文收入到精華區:因為在linux gcc安裝這個討論話題中,有許多相關的文章在討論,這篇最有參考價值!作者whisp1222 ()看板Linux標題[問題] 安裝舊版gcc的問題時間Thu Mar 11...
我現在想要安裝舊版的gcc-3.2.2
(OS:CentOS 5.4, gcc版本 4.1.2)
指令:
../gcc-3.2.2/configure --enable-languages=c,c++ \
--prefix=~shinchun/util/gcc-3.2.2
make bootstrap
原本一開始會有以下錯誤
===================================================================
make[3]: *** [ada.o] Error 1
make[3]: Leaving directory
`/opt/opt/nfs_home/shinchun/opt/install/gcc-3.2.2/gcc/ada'
make[2]: *** [gnat1] Error 2 make[2]: Leaving directory
`/opt/opt/nfs_home/shinchun/opt/install/gcc-3.2.2/gcc'
make[1]: *** [stage1_build] Error 2
make[1]: Leaving directory
`/opt/opt/nfs_home/shinchun/opt/install/gcc-3.2.2/gcc'
make: *** [bootstrap] Error 2
====================================================================
後來google找到以下的解答
====================================================================
Edit the file include/obstack.h in the gcc-3.2.2 source package.
Go to line 423 and change it from:
*((void **)__o->next_free)++ = ((void *)datum); \
to:
*((void **)__o->next_free) = ((void *)datum); \
and add the line
__o->next_free += sizeof(void *); \
====================================================================
但是make clean
make bootstrap以後卻又發生另一個錯誤
這下google也沒用了 ||orz(還是沒打對關鍵字?)
=====================================================================
make[4]: *** [libstdc++.la] Error 1
make[4]: Leaving directory
`/home/shinchun/install/gcc-3.2.2/i686-pc-linux-gnu/libstdc++-v3/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory
`/home/shinchun/install/gcc-3.2.2/i686-pc-linux-gnu/libstdc++-v3'
make[2]: *** [all-recursive-am] Error 2
make[2]: Leaving directory
`/home/shinchun/install/gcc-3.2.2/i686-pc-linux-gnu/libstdc++-v3'
make[1]: *** [all-target-libstdc++-v3] Error 2
make[1]: Leaving directory `/home/shinchun/install/gcc-3.2.2'
make: *** [bootstrap] Error 2
======================================================================
麻煩高手解惑
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.116.245.6
※ 編輯: whisp1222 來自: 140.116.245.6 (03/11 23:33)
你的意思應該是說我缺少了某些套件 或是套件有問題(版本....)
但是make bootstrap不就是用在系統沒有任何compiler的情況下???
只要有source code 他應該就可以獨立建立出gcc
照理來說應該不會有pacjage depend的問題阿