glibc 安装:无法计算目标文件的后缀
我正在尝试使用 gcc v3.4.6 在我的 Ubuntu 上安装 glibc 2.3.2,但遇到了问题。 Glibc 应该是为 mips 构建的。我在32位和64位机器上都尝试过,但仍然是同样的问题。 configure
的输入参数是:
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.
我首先想到的问题是我没有设置BUILD
,HOST,
TARGET
正确,所以我将 HOST
更改为 mipseb-linux
,但错误和日志仍然相同。
I am trying to install glibc 2.3.2 on my Ubuntu using gcc v3.4.6, but have faced a problem. Glibc should be built for mips. I tried it on both 32-bit and 64-bit machines, but still the same problem. The input parameters to configure
are:
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} ....
the error is:
...
checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
and the 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.
I first thought the problem is that I have not set BUILD
, HOST
, TARGET
correctly, so I changed HOST
to mipseb-linux
, but the error and log are still the same.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现我做错了什么。由于我在计算机上安装了几个不同的 GCC,因此
configure
和makefile
选择了错误的 GCC。尽管他们选择了正确版本 (3.4) 的 GCC,但他们选择的是 i686 的 GCC,而不是选择与 mips 兼容的 GCC。有两种解决方案:在运行
configure
和make
之前定义以下变量:目标=mipseb-linux
CC=${TARGET}-gcc-3.4.4
BUILD_CC=gcc
AR=${TARGET}-ar
RANLIB=${TARGET}-ranlib
I found what I was doing wrong. Since I had installed a couple of different GCCs on my machine, the
configure
andmakefile
were picking the wrong GCC. Even though they were picking GCC with the right version (3.4), they were picking GCC for i686 instead of picking a mips-compatible GCC. There are two solutions for that:Defining the following variables prior to running
configure
andmake
:TARGET=mipseb-linux
CC=${TARGET}-gcc-3.4.4
BUILD_CC=gcc
AR=${TARGET}-ar
RANLIB=${TARGET}-ranlib