1

I'm compiling GCC on a build server to get access to the latest version of gfortran; after building gmp, mpfr, and mpc into specially-prefixed directories in usr/local, I configured and make'd gcc, which resulted in the following errors:

../../gcc/cp/g++spec.c: In function ‘void lang_specific_driver(cl_decoded_option**, unsigned int*, int*)’:
../../gcc/cp/g++spec.c:352: warning: NULL used in arithmetic
/usr/bin/ld: warning: libgmp.so.3, needed by /usr/local/mpfr-3.1.2/lib/libmpfr.so, may conflict with libgmp.so.10
configure: error: in `/tabletop/scratch/gcc-4.9.1/build/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2

Inside config.log is the following:

configure:3373: $? = 0
configure:3362: /tabletop/scratch/gcc-4.9.1/build/./gcc/xgcc -B/tabletop/scratch/gcc-4.9.1/build/./gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include    -v >&5
Reading specs from /tabletop/scratch/gcc-4.9.1/build/./gcc/specs
COLLECT_GCC=/tabletop/scratch/gcc-4.9.1/build/./gcc/xgcc
COLLECT_LTO_WRAPPER=/tabletop/scratch/gcc-4.9.1/build/./gcc/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --disable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran --with-gmp=/usr/local/gmp-6.0.0 --with-mpfr=/usr/local/mpfr-3.1.2 --with-mpc=/usr/local/mpc-1.0.2
Thread model: posix
gcc version 4.9.1 (GCC)
configure:3373: $? = 0
configure:3362: /tabletop/scratch/gcc-4.9.1/build/./gcc/xgcc -B/tabletop/scratch/gcc-4.9.1/build/./gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include    -V >&5
xgcc: error: unrecognized command line option '-V'
xgcc: fatal error: no input files
compilation terminated.
configure:3373: $? = 1
configure:3362: /tabletop/scratch/gcc-4.9.1/build/./gcc/xgcc -B/tabletop/scratch/gcc-4.9.1/build/./gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include    -qversion >&5
xgcc: error: unrecognized command line option '-qversion'
xgcc: fatal error: no input files
compilation terminated.
configure:3373: $? = 1
configure:3389: /tabletop/scratch/gcc-4.9.1/build/./gcc/xgcc -B/tabletop/scratch/gcc-4.9.1/build/./gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include    -o conftest -g -O2   conftest.c  >&5
/tabletop/scratch/gcc-4.9.1/build/./gcc/cc1: error while loading shared libraries: libmpc.so.3: cannot open shared object file: No such file or directory
configure:3392: $? = 1
configure:3580: checking for suffix of object files
configure:3602: /tabletop/scratch/gcc-4.9.1/build/./gcc/xgcc -B/tabletop/scratch/gcc-4.9.1/build/./gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include    -c -g -O2  conftest.c >&5
/tabletop/scratch/gcc-4.9.1/build/./gcc/cc1: error while loading shared libraries: libmpc.so.3: cannot open shared object file: No such file or directory
configure:3606: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Runtime Library"
| #define PACKAGE_TARNAME "libgcc"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "GNU C Runtime Library 1.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL "http://www.gnu.org/software/libgcc/"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3620: error: in `/tabletop/scratch/gcc-4.9.1/build/x86_64-unknown-linux-gnu/libgcc':
configure:3623: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.

The first log (the stderr output of make) seems to indicate there's a conflict between libgmp.so and libmpc.so, but the second (config.log from build/x86_64-unknown-linux-gnu/include) seems to show "-V" getting passed as a file and causing a missing input error. I've grepped recursively through the whole build directory and I haven't found anything that matches that broken option- can anyone shed some light on what might be the original cause(s) of these issues?

0

Building GCC sources was a pain in the a** but succeded in the end by folowing these simple steps :

after dowloading gcc-5.2.0.tar.gz and unzip/untar you should have a directory names gcc-5.2.0.

you must download few other packages like gmp mpc mpfr :

cd gcc-5.2.0
./contrib/download_prerequisites

it will download and untar gmp mpc mpfr

It's hardly recommanded to do not build gcc from the sources directory so we begin :

mkdir gcc-build
cd gcc-build
.././configure (with your options)
make
make install

I suggest you start with a :

make distclean

in de gcc folder to delete everything was build before starting anything

Hope it helps and good luck

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.