How can I avoid the dreaded "cannot compute suffix of object files"?

Dr. David Kirkby
Thu Feb 11 12:05:00 GMT 2010

I'm trying to build gcc 4.3.2 on a Sun Blade 1000 running Solaris 10 03/05 
(there are good reasons for wanting to use an older release of Solaris 10).

I've patched

1)  Patched the included gcc 3.4.3 with Sun's latest patch for gcc (123647-04)

2) Set environment variables.

$ export LD_OPTIONS=-R/usr/local/gcc-4.3.4/lib -L/usr/local/gcc-4.3.4/lib
$ export LDFLAGS=-R/usr/local/gcc-4.3.4/lib -L/usr/local/gcc-4.3.4/lib

3) GMP related things.

* export ABI=32
* Configured gmp with a prefix of /usr/local/gcc-4.3.2
* Built gmp
* Verified gmp passes all tests.
* Installed gmp to /usr/local/gcc-4.3.2

4) MPFR related things.

* Configured mpfr with a prefix of /usr/local/gcc-4.3.2
* Built mpfr
* Verified mpfr passes all tests.
* Installed mprf to /usr/local/gcc-4.3.2

5) GCC related things.

../gcc-4.4.3/configure  --prefix=/usr/local/gcc-4.4.3 
--with-build-time-tools=/usr/ccs/bin --with-gmp=/usr/local/gcc-4.4.3 
--enable-languages=c,c++,fortran --with-boot-ldflags="-R/usr/local/gcc-4.4.3/lib 

The sate 2 build fails with the error message "cannot compute suffix of object 
files", which is a result of it being unable to find the path to the mpfr 
library. This is despite the fact I've done everything I can think of to get gcc 
to look in /usr/local/gcc-4.4.3/lib for the mpfr libraries.

A Google on this message shows 901,000 hits. Adding 'gcc' into the search term 
finds this drops to 761,000, so I'm far from the only one to get this message.

The appropriate config.log


Target: sparc-sun-solaris2.10
Configured with: ../gcc-4.4.3/configure --prefix=/usr/local/gcc-4.4.3 
--with-mpfr-include=/usr/local/gcc-4.4.3/include --
with-build-time-tools=/usr/ccs/bin --with-gmp=/usr/local/gcc-4.4.3 
--enable-languages=c,c++,fortran --with-boot-ldflags='-R/usr/local/gcc-4.4.3/lib 
Thread model: posix
gcc version 4.4.3 (GCC)
configure:2391: $? = 0
configure:2393: /patches/builds/build-gcc/./gcc/xgcc 
-B/usr/local/gcc-4.4.3/sparc-sun-solaris2.10/bin/ -B/usr/local/gcc-4.4.3/s
parc-sun-solaris2.10/lib/ -isystem 
/usr/local/gcc-4.4.3/sparc-sun-solaris2.10/include -isystem 
/usr/local/gcc-4.4.3/sparc-sun-solaris2.10/sys-include -V </dev/nul
l >&5
xgcc: '-V' must come at the start of the command line
configure:2396: $? = 1
configure:2415: /patches/builds/build-gcc/./gcc/xgcc 
-B/usr/local/gcc-4.4.3/sparc-sun-solaris2.10/bin/ -B/usr/local/gcc-4.4.3/s
parc-sun-solaris2.10/lib/ -isystem 
/usr/local/gcc-4.4.3/sparc-sun-solaris2.10/include -isystem 
/usr/local/gcc-4.4.3/sparc-sun-solaris2.10/sys-include -o conftest
-g -O2     conftest.c  >&5 /patches/builds/build-gcc/gcc/cc1: fatal: open failed: No 
such file or directory
xgcc: Internal error: Killed (program cc1)
Please submit a full bug report.
See <> for instructions.

I know from experience adding the directory of the mpfr libraries to 
LD_LIBRARY_PATH, but it is generally reconised as poor practice to do this.

I reported this as a bug for 4.3.1 some time ago

A suggestion was made to use

export LD_OPTIONS='-R/opt/csw/lib/$ISALIST'
(obviously I'd need to change the patch, as I'm not putting binaries under 
/opt/csw), but even that is not working for me.

Can anyone suggest how I can build gcc on Solaris so it does not need 
LD_LIBRARY_PATH set and compile-time and run-time?

What more can I possibly try?


More information about the Gcc-help mailing list