meganathan
meganathan

Reputation: 91

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

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?

Upvotes: 9

Views: 19126

Answers (3)

Axel Borja
Axel Borja

Reputation: 3974

"*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

Upvotes: 2

77H3jjuu
77H3jjuu

Reputation: 352

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

Upvotes: 1

Jonathan Wakely
Jonathan Wakely

Reputation: 171273

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.

Upvotes: 13

Related Questions