Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile

Tags:

gcc

toolchain

While building ARM toolchain , I got the following error

checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1
make[1]: Leaving directory `<path>/gcc-4.3.2-arm-elf'
make: *** [all] Error 2

what might be the problem?

like image 961
meganathan Avatar asked Sep 29 '12 06:09

meganathan


3 Answers

Did you read http://gcc.gnu.org/wiki/FAQ#configure_suffix ?

Have you installed GMP, MPFR and MPC? Are they in your library search path?

See http://gcc.gnu.org/wiki/InstallingGCC and make sure you've followed the basic instructions. By far the simplest way to build GCC (including as a cross compiler) is to follow these instructions:

  • Alternatively, after extracting the GCC source archive, simply run the ./contrib/download_prerequisites script in the GCC source directory. That will download the support libraries and create symlinks, causing them to be built automatically as part of the GCC build process.
like image 199
Jonathan Wakely Avatar answered Nov 06 '22 18:11

Jonathan Wakely


"*Building GCC is not trivial, but is not difficult if you follow the instructions carefully. Many people rush into trying to build it without reading the installation docs properly and make one or more of these common mistakes:

1) do not run ./configure from gcc src dir (this is not supported) => you need to run configure from outside the gcc source directory

2) Note: if GCC links dynamically to the prerequisite libs (GMP/MPFR/MPC) then the shared libraries must be in the dynamic linker's path (LD_LIBRARY_PATH), both when building gcc and when using the installed compiler.*"

Simple example (without dynamic link to GMP/MPFR/MPC):

tar xzf gcc-4.8.0.tar.gz
cd gcc-4.8.0
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.8.0/configure --prefix=/opt/gcc-4.8.0 
make
make install

Sources: Advogato Doc - GNU Doc

like image 28
Axel Borja Avatar answered Nov 06 '22 17:11

Axel Borja


export LD_LIBRARY_PATH=/path/for/libraries:$LD_LIBRARY_PATH

path/for/libraries is where the GMP MPFR and MPC libraries are present.

I was compiling GCC on ubuntu 12.04 and these linraries present in the path /usr/local/lib

like image 1
7H3ju Avatar answered Nov 06 '22 17:11

7H3ju