0

I'm trying to install GCC 4.7.1 following this very good tutorial. I did (almost) everything by the book, but I get the following error during make

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

This is my configure command, the only thing I changed in that tutorial is the file gcc-4.7.1, that's all.

 ../gcc-4.7.1/configure --build=x86_64-linux-gnu --prefix=/usr/gcc_4_7 --with 
 gmp=/usr/gcc_4_7 --with-mpfr=/usr/gcc_4_7 --with-mpc=/usr/gcc_4_7 --enable-
 checking=release --enable-languages=c,c++ --disable-multilib --program-suffix=-4.7

I've looked in Google, and most of the answers seem to point to the way gcc loads the includes for mpfr, mpc, and gmp, so I symlinked the folders in the gcc-4.7 directory (I'm building outside the source directory, as per general recommendation).

Any ideas about what I'm doing wrong?

Dervin Thunk
  • 19,515
  • 28
  • 127
  • 217

1 Answers1

1

Try export LD_LIBRARY_PATH=/usr/local/gmp-4.1.3/lib:/usr/local/mpfr-2.3.2/lib:$LD_LIBRARY_PATH, replacing the paths with the location where mpfr and gmp are installed on your machine, if necessary.

Chris
  • 1,416
  • 18
  • 29
  • Just to be clear, when you say "mpfr" and "gpm" you mean `libgmp.so.10.0.5`, that is, the libs?? – Dervin Thunk Aug 15 '12 at 19:20
  • Yes, I do. Some versions of GCC have an issue where the `--with-mpfr` and `--with-gmp` flags don't work, but setting the LD_LIBRARY_PATH fixes it. – Chris Aug 15 '12 at 19:49
  • This was correct. However, there was another problem: crtio.o not found. I'm documenting it here for other people who might be wondering too. I found the answer here: http://stackoverflow.com/questions/6329887/compiling-problems-cannot-find-crt1-o. Still, this was the right response. Accepted! Thanks. – Dervin Thunk Aug 15 '12 at 20:02