glibc 安装:无法计算目标文件的后缀

发布于 2025-01-06 11:04:42 字数 1653 浏览 2 评论 0原文

我正在尝试使用 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.

我首先想到的问题是我没有设置BUILDHOST, 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

葮薆情 2025-01-13 11:04:42

我发现我做错了什么。由于我在计算机上安装了几个不同的 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

I found what I was doing wrong. Since I had installed a couple of different GCCs on my machine, the configure and makefile 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:

  1. Removing the wrong GCC from your PATH. I ended up not doing that for some reason.
  2. Defining the following variables prior to running configure and make:

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文