2012-02-17 96 views
1

我想在我的Ubuntu上使用gcc v3.4.6安裝glibc 2.3.2,但遇到了問題。 Glibc應該爲mips而建造。我在32位和64位機器上都試過,但仍然是同樣的問題。輸入參數configure是:glibc安裝:無法計算目標文件的後綴

BUILD="i686-pc-linux-gnu" 
HOST="i686-pc-linux-gnu" 
TARGET=mipseb-linux 
export CFLAGS="-O2 -mips2 -mabi=32 -fno-PIC -mno-abicalls" 
export CZFLAGS="-mips2 -mabi=32 -fno-PIC -mno-abicalls" 
./configure --build=${BUILD} --host=${HOST} --target=${TARGET} .... 

的錯誤是:

...  
checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile 
See `config.log' for more details. 

和的config.log:

... 
configure:2941: $? = 1 
configure:2945: checking for suffix of object files 
configure:2967: gcc-3.4 -c -O2 -mips2 -mabi=32 -fno-PIC -mno-abicalls conftest.c >&5 
cc1: error: invalid option `ips2' 
cc1: error: invalid option `abi=32' 
cc1: error: invalid option `no-abicalls' 
configure:2970: $? = 1 
configure: failed program was: 
| #line 2950 "configure" 
| /* confdefs.h. */ 
| 
| #define PACKAGE_NAME "GNU C Library" 
| #define PACKAGE_TARNAME "c-library" 
| #define PACKAGE_VERSION "(see version.h)" 
| #define PACKAGE_STRING "GNU C Library (see version.h)" 
| #define PACKAGE_BUGREPORT "glibc" 
| #define DO_STATIC_NSS 1 
| #define USE_REGPARMS 1 
| /* end confdefs.h. */ 
| 
| int 
| main() 
| { 
| 
| ; 
| return 0; 
| } 
configure:2984: error: cannot compute suffix of object files: cannot compile 
See `config.log' for more details. 

我首先想到的問題是,我沒有設置BUILDHOST,TARGET正確,所以我將HOST更改爲mipseb-linux,但錯誤和日誌仍然是t他一樣。

+0

any any idea? – aminfar 2012-02-21 22:33:31

回答

3

我發現我做錯了。由於我在我的機器上安裝了幾個不同的GCC,因此configuremakefile選擇了錯誤的GCC。儘管他們選擇了正確版本(3.4)的GCC,但他們選擇的是GCC for i686,而不是選擇mips兼容的GCC。有兩種解決方案:

  1. 從PATH中刪除錯誤的GCC。出於某種原因,我最終沒有這樣做。
  2. 定義以下變量運行configuremake之前:

    TARGET = mipseb Linux的
    CC = $ {TARGET}-GCC-3.4.4
    BUILD_CC = GCC
    AR = $ {TARGET } -ar
    RANLIB = $ {TARGET} -ranlib

+0

+1這對我也有幫助.. – 2013-04-01 07:36:12