2012-05-21 60 views
2

我想從源代碼編譯器爲Cyclone編程語言構建。我正在運行默認安裝了GCC 4.6.3的32位Ubuntu 12.04。GCC降級問題

但由於bootstrap實用程序中的崩潰導致make失敗。要解決這個問題,我正在嘗試安裝較舊的GCC版本。

我修補了/etc/apt/sources.list,並使用apt-get安裝了gcc-3.3和g ++-3.3。但是,配置時,它被強制使用GCC 3.3腳本失敗:

$ export CC=gcc-3.3 
$ export CXX=g++-3.3 
$ ./configure 
checking build system type... i686-pc-linux-gnu 
checking host system type... i686-pc-linux-gnu 
checking target system type... i686-pc-linux-gnu 
checking for gcc... gcc-3.3 
checking for C compiler default output file name... configure: error: C compiler cannot create executables 
See `config.log' for more details. 

而且顯示的config.log:

... 
/usr/bin/ld: cannot find crt1.o: No such file or directory 
/usr/bin/ld: cannot find crti.o: No such file or directory 
/usr/bin/ld: cannot find -lgcc_s 
... 

LD的版本是2.22

回答

1

apt-file search crt1.o顯示哪個包包含這個文件。如果它不打印任何內容,請運行apt-file update一次。

2

我也有過這個相同的問題。 libc6-dev軟件包提供了crt1.o文件,但它安裝在gcc的非標準目錄中。這是爲了在同一主機上支持32位和64位程序。

要解決這個問題,我設置了以下環境變量:

出口LIBRARY_PATH =/usr/lib目錄/ I386-Linux的GNU

0

米歇爾提到的,你可以做到這一點,以獲得舊的GCC來引導:

export LIBRARY_PATH=/usr/lib/i386-linux-gnu 

爲徘徊無論在crt1.o文件是您的系統上 - 對礦井,它在/usr/lib32

然後,一旦你已經建立了一個工作GCC,你可以符號鏈接(或複製)crt1.ocrti.o,並且crtn.o${prefix}/lib/gcc/...目錄中新建的編譯器,你就不會需要設置LIBRARY_PATH你的時候用它。查找crtstart.o文件或類似的東西,這是將符號鏈接放入的正確目錄。