Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

glibc installation: cannot compute suffix of object files

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.

like image 848
aminfar Avatar asked Dec 29 '25 11:12

aminfar


1 Answers

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

like image 148
aminfar Avatar answered Dec 31 '25 23:12

aminfar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!