Page 1 of 1

Building libgcc cross compiler error: cannot compute suffix

Posted: Sat May 31, 2014 7:10 am
by tetra
Hello everyone,

I've searched all over internet how to solve libgcc error when building cross compiler.
But none of them didn't help to solve my problem.

The os that I'm using is ubuntu 14.04.
The versions that I use to create cross compiler are:
gcc 4.9.0
binutils 2.9.1
gmp 6.0.0
mpfr 3.1.2
mpc 1.0.2

Errors that I get.
$> make all-target-libgcc
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-elf
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... mawk
checking for i686-elf-ar... i686-elf-ar
checking for i686-elf-lipo... i686-elf-lipo
checking for i686-elf-nm... /home/test/src/build-gcc/./gcc/nm
checking for i686-elf-ranlib... i686-elf-ranlib
checking for i686-elf-strip... i686-elf-strip
checking whether ln -s works... yes
checking for i686-elf-gcc... /home/test/src/build-gcc/./gcc/xgcc -B/home/test/src/build-gcc/./gcc/ -B/home/test/opt/cross/i686-elf/bin/ -B/home/test/opt/cross/i686-elf/lib/ -isystem /home/test/opt/cross/i686-elf/include -isystem /home/test/opt/cross/i686-elf/sys-include
checking for suffix of object files... configure: error: in `/home/test/src/build-gcc/i686-elf/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make: *** [configure-target-libgcc] Error 1
$> make install-target-libgcc
/bin/bash ../gcc-4.9.0/mkinstalldirs /home/test/opt/cross /home/test/opt/cross
make[1]: Entering directory `/home/test/src/build-gcc/i686-elf/libgcc'
make[1]: *** No rule to make target `install'. Stop.
make[1]: Leaving directory `/home/test/src/build-gcc/i686-elf/libgcc'
make: *** [install-target-libgcc] Error 2
I don know if this has somthing to do with the error, but binutils gave also an error.

$> make install
usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/sbin" ldconfig -n /home/test/opt/cross/lib
------------------------------------------------------------------------------
Libraries have been installed in:
/home/test/opt/cross/lib

To link against installed libraries in a given directory, LIBDIR,
you must use the `-LLIBDIR' flag during linking.

You will also need to do one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
------------------------------------------------------------------------------
make[1]: Leaving directory `/home/test/src/build-binutils/opcodes'
make[1]: Entering directory `/home/test/src/build-binutils/binutils'
make[1]: *** No rule to make target `../libiberty/libiberty.a', needed by `size'. Stop.
make[1]: Leaving directory `/home/test/src/build-binutils/binutils'
make: *** [install-binutils] Error 2

Re: Building libgcc cross compiler error: cannot compute suf

Posted: Sat May 31, 2014 7:21 am
by Octocontrabass
tetra wrote:binutils 2.9.1
1998 was a long time ago. Why don't you try a newer version? I believe 2.24 is the latest.

Re: Building libgcc cross compiler error: cannot compute suf

Posted: Sat May 31, 2014 7:42 am
by Combuster
It looks like there are several problems to solve here. The thing with 2.9 is that it's known not to build, and that whoever still uses it didn't actually read the tutorial properly because versions are mentioned repeatedly. Also, the fact that you forcibly continued after the first error indicates some prior experience issues.

Try to apply a bit more scrutiny to your own work, and also consider to what extent the "Required Knowledge" rule applies to you - you might want to read up on several other thing you are likely to encounter sometime soon.

Re: Building libgcc cross compiler error: cannot compute suf

Posted: Sat May 31, 2014 8:05 am
by tetra
Thanks Octocontrabass, that did the trick.