gcc - glibc安装: cannot compute suffix of object files

标签 gcc configure glibc

我尝试使用 gcc v3.4.6 在 Ubuntu 上安装 glibc 2.3.2,但遇到了问题。 Glibc 应该是为 mips 构建的。我在32位和64位机器上都尝试过,但仍然是同样的问题。 配置的输入参数为:

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.

我首先想到的问题是我没有正确设置BUILDHOSTTARGET,所以我改变了HOSTmipseb-linux,但错误和日志仍然相同。

最佳答案

我发现我做错了什么。由于我在计算机上安装了几个不同的 GCC,因此 configuremakefile 选择了错误的 GCC。尽管他们选择了正确版本 (3.4) 的 GCC,但他们选择的是 i686 的 GCC,而不是选择与 mips 兼容的 GCC。有两种解决方案:

  1. 从您的 PATH 中删除错误的 GCC。由于某种原因我最终没有这样做。
  2. 在运行 configuremake 之前定义以下变量:

    目标=mipseb-linux
    CC=${TARGET}-gcc-3.4.4
    BUILD_CC=gcc
    AR=${TARGET}-ar
    RANLIB=${TARGET}-ranlib

关于gcc - glibc安装: cannot compute suffix of object files,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9323513/

相关文章:

c++ - 在 vs 2003 上将管道(处理程序)转换为 fd 时出错

c - 具有相同名称和类型的两个变量,在两个不同的 .c 文件中,使用 gcc 编译

c++ - 为什么 MSVC 和 GCC 不能使用具有默认值的字段初始化结构

c++ - 在 Mac OS X 上以多态方式捕获 -fno-rtti 共享库中的异常

linux - 在同一台服务器上安装多个 sqlite

linux - 如何强制配置脚本生成发布makefile

c - 预测由 C (glibc) rand() 生成的下一个数字

c - 外部关键字的工作

linux - 编译zabbix-server时未找到z库

c - 为什么 execve 系统调用可以在没有任何 argv 参数的情况下运行 "/bin/sh"而不是 "/bin/ls"?