Trouble with cross compiler - "cannot compute suffix"

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
mango
Posts: 8
Joined: Sun May 25, 2014 6:36 pm

Trouble with cross compiler - "cannot compute suffix"

Post by mango »

I'm getting started with Bare Bones, and the as a first step am creating a cross compiler on Debian Wheezy. All the gcc related steps are working, but I'm having trouble building libgcc. When I run make all-target-libgcc, I get

Code: Select all

checking for suffix of object files... configure: error: in `/home/vagrant/src/build-gcc/i686-elf/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
The config.log file has:

Code: Select all

configure:3371:  /home/vagrant/src/build-gcc/./gcc/xgcc -B/home/vagrant/src/build-gcc/./gcc/ -B/home/vagrant/opt/cross/i686-elf/bin/ -B/home/vagrant/opt/cross/i686-elf/lib/ -isystem /home/vagrant/opt/cross/i686-elf/include -isystem /home/vagrant/opt/cross/i686-elf/sys-include    -o conftest -g -O2   conftest.c  >&5
/home/vagrant/src/build-gcc/./gcc/as: 87: exec: -o: not found
configure:3374: $? = 1
configure:3562: checking for suffix of object files
configure:3584:  /home/vagrant/src/build-gcc/./gcc/xgcc -B/home/vagrant/src/build-gcc/./gcc/ -B/home/vagrant/opt/cross/i686-elf/bin/ -B/home/vagrant/opt/cross/i686-elf/lib/ -isystem /home/vagrant/opt/cross/i686-elf/include -isystem /home/vagrant/opt/cross/i686-elf/sys-include    -c -g -O2  conftest.c >&5
/home/vagrant/src/build-gcc/./gcc/as: 87: exec: -o: not found
configure:3588: $? = 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;
| }
I tried adding the path to the libmpc, libgmp, and libmpfr to the ld path, but got the same result. I have multiple libmpc.so files in /usr/lib/i386-linux-gnu, not sure if that is an issue, as I both apt-getted those libraries and ran the gcc dependency download script. Anybody been here before?
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Trouble with cross compiler - "cannot compute suffix"

Post by sortie »

This seems unusually odd. Can you please dump all your environmental variables using env (1) and provide a full log of everything you typed and all the output? I couldn't spot the issue from the above log. Does your compiler work?
mango
Posts: 8
Joined: Sun May 25, 2014 6:36 pm

Re: Trouble with cross compiler - "cannot compute suffix"

Post by mango »

The output for env is:

Code: Select all

TERM=xterm
SHELL=/bin/bash
SSH_CLIENT=10.0.2.2 54837 22
SSH_TTY=/dev/pts/0
USER=vagrant
LD_LIBRARY_PATH=:/usr/lib/i386-linux-gnu/
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
MAIL=/var/mail/vagrant
PATH=/home/vagrant/opt/cross/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
PWD=/home/vagrant/src/build-gcc
LANG=en_US.UTF-8
SHLVL=1
HOME=/home/vagrant
TARGET=i686-elf
LOGNAME=vagrant
PREFIX=/home/vagrant/opt/cross
SSH_CONNECTION=10.0.2.2 54837 10.0.2.15 22
OLDPWD=/home/vagrant/src
_=/usr/bin/env
The output for make all-target-libgcc, the failing command, is as follows:

Code: Select all

make[1]: Entering directory `/home/vagrant/src/build-gcc/libiberty'
make[2]: Entering directory `/home/vagrant/src/build-gcc/libiberty/testsuite'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/vagrant/src/build-gcc/libiberty/testsuite'
make[1]: Leaving directory `/home/vagrant/src/build-gcc/libiberty'
make[1]: Entering directory `/home/vagrant/src/build-gcc/lto-plugin'
make  all-am
make[2]: Entering directory `/home/vagrant/src/build-gcc/lto-plugin'
make[2]: Leaving directory `/home/vagrant/src/build-gcc/lto-plugin'
make[1]: Leaving directory `/home/vagrant/src/build-gcc/lto-plugin'
make[1]: Entering directory `/home/vagrant/src/build-gcc/gmp'
make  all-recursive
make[2]: Entering directory `/home/vagrant/src/build-gcc/gmp'
Making all in tests
make[3]: Entering directory `/home/vagrant/src/build-gcc/gmp/tests'
Making all in .
make[4]: Entering directory `/home/vagrant/src/build-gcc/gmp/tests'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/home/vagrant/src/build-gcc/gmp/tests'
Making all in devel
make[4]: Entering directory `/home/vagrant/src/build-gcc/gmp/tests/devel'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/vagrant/src/build-gcc/gmp/tests/devel'
Making all in mpn
make[4]: Entering directory `/home/vagrant/src/build-gcc/gmp/tests/mpn'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/vagrant/src/build-gcc/gmp/tests/mpn'
Making all in mpz
make[4]: Entering directory `/home/vagrant/src/build-gcc/gmp/tests/mpz'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/vagrant/src/build-gcc/gmp/tests/mpz'
Making all in mpq
make[4]: Entering directory `/home/vagrant/src/build-gcc/gmp/tests/mpq'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/vagrant/src/build-gcc/gmp/tests/mpq'
Making all in mpf
make[4]: Entering directory `/home/vagrant/src/build-gcc/gmp/tests/mpf'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/vagrant/src/build-gcc/gmp/tests/mpf'
Making all in rand
make[4]: Entering directory `/home/vagrant/src/build-gcc/gmp/tests/rand'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/vagrant/src/build-gcc/gmp/tests/rand'
Making all in misc
make[4]: Entering directory `/home/vagrant/src/build-gcc/gmp/tests/misc'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/vagrant/src/build-gcc/gmp/tests/misc'
Making all in cxx
make[4]: Entering directory `/home/vagrant/src/build-gcc/gmp/tests/cxx'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/vagrant/src/build-gcc/gmp/tests/cxx'
Making all in mpbsd
make[4]: Entering directory `/home/vagrant/src/build-gcc/gmp/tests/mpbsd'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/vagrant/src/build-gcc/gmp/tests/mpbsd'
make[3]: Leaving directory `/home/vagrant/src/build-gcc/gmp/tests'
Making all in mpn
make[3]: Entering directory `/home/vagrant/src/build-gcc/gmp/mpn'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/vagrant/src/build-gcc/gmp/mpn'
Making all in mpz
make[3]: Entering directory `/home/vagrant/src/build-gcc/gmp/mpz'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/vagrant/src/build-gcc/gmp/mpz'
Making all in mpq
make[3]: Entering directory `/home/vagrant/src/build-gcc/gmp/mpq'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/vagrant/src/build-gcc/gmp/mpq'
Making all in mpf
make[3]: Entering directory `/home/vagrant/src/build-gcc/gmp/mpf'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/vagrant/src/build-gcc/gmp/mpf'
Making all in printf
make[3]: Entering directory `/home/vagrant/src/build-gcc/gmp/printf'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/vagrant/src/build-gcc/gmp/printf'
Making all in scanf
make[3]: Entering directory `/home/vagrant/src/build-gcc/gmp/scanf'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/vagrant/src/build-gcc/gmp/scanf'
Making all in cxx
make[3]: Entering directory `/home/vagrant/src/build-gcc/gmp/cxx'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/vagrant/src/build-gcc/gmp/cxx'
Making all in mpbsd
make[3]: Entering directory `/home/vagrant/src/build-gcc/gmp/mpbsd'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/vagrant/src/build-gcc/gmp/mpbsd'
Making all in demos
make[3]: Entering directory `/home/vagrant/src/build-gcc/gmp/demos'
Making all in calc
make[4]: Entering directory `/home/vagrant/src/build-gcc/gmp/demos/calc'
make  all-am
make[5]: Entering directory `/home/vagrant/src/build-gcc/gmp/demos/calc'
make[5]: Nothing to be done for `all-am'.
make[5]: Leaving directory `/home/vagrant/src/build-gcc/gmp/demos/calc'
make[4]: Leaving directory `/home/vagrant/src/build-gcc/gmp/demos/calc'
Making all in expr
make[4]: Entering directory `/home/vagrant/src/build-gcc/gmp/demos/expr'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/vagrant/src/build-gcc/gmp/demos/expr'
make[4]: Entering directory `/home/vagrant/src/build-gcc/gmp/demos'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/home/vagrant/src/build-gcc/gmp/demos'
make[3]: Leaving directory `/home/vagrant/src/build-gcc/gmp/demos'
Making all in tune
make[3]: Entering directory `/home/vagrant/src/build-gcc/gmp/tune'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/vagrant/src/build-gcc/gmp/tune'
Making all in doc
make[3]: Entering directory `/home/vagrant/src/build-gcc/gmp/doc'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/vagrant/src/build-gcc/gmp/doc'
make[3]: Entering directory `/home/vagrant/src/build-gcc/gmp'
make[3]: Leaving directory `/home/vagrant/src/build-gcc/gmp'
make[2]: Leaving directory `/home/vagrant/src/build-gcc/gmp'
make[1]: Leaving directory `/home/vagrant/src/build-gcc/gmp'
make[1]: Entering directory `/home/vagrant/src/build-gcc/intl'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/vagrant/src/build-gcc/intl'
make[1]: Entering directory `/home/vagrant/src/build-gcc/mpfr'
Making all in tests
make[2]: Entering directory `/home/vagrant/src/build-gcc/mpfr/tests'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/vagrant/src/build-gcc/mpfr/tests'
make[2]: Entering directory `/home/vagrant/src/build-gcc/mpfr'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/home/vagrant/src/build-gcc/mpfr'
make[1]: Leaving directory `/home/vagrant/src/build-gcc/mpfr'
make[1]: Entering directory `/home/vagrant/src/build-gcc/mpc'
make  all-recursive
make[2]: Entering directory `/home/vagrant/src/build-gcc/mpc'
Making all in src
make[3]: Entering directory `/home/vagrant/src/build-gcc/mpc/src'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/vagrant/src/build-gcc/mpc/src'
Making all in tests
make[3]: Entering directory `/home/vagrant/src/build-gcc/mpc/tests'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/vagrant/src/build-gcc/mpc/tests'
Making all in doc
make[3]: Entering directory `/home/vagrant/src/build-gcc/mpc/doc'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/vagrant/src/build-gcc/mpc/doc'
make[3]: Entering directory `/home/vagrant/src/build-gcc/mpc'
make[3]: Leaving directory `/home/vagrant/src/build-gcc/mpc'
make[2]: Leaving directory `/home/vagrant/src/build-gcc/mpc'
make[1]: Leaving directory `/home/vagrant/src/build-gcc/mpc'
make[1]: Entering directory `/home/vagrant/src/build-gcc/build-i686-pc-linux-gnu/libiberty'
make[2]: Entering directory `/home/vagrant/src/build-gcc/build-i686-pc-linux-gnu/libiberty/testsuite'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/vagrant/src/build-gcc/build-i686-pc-linux-gnu/libiberty/testsuite'
make[1]: Leaving directory `/home/vagrant/src/build-gcc/build-i686-pc-linux-gnu/libiberty'
make[1]: Entering directory `/home/vagrant/src/build-gcc/build-i686-pc-linux-gnu/fixincludes'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/vagrant/src/build-gcc/build-i686-pc-linux-gnu/fixincludes'
make[1]: Entering directory `/home/vagrant/src/build-gcc/zlib'
true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g -O2" "CXXFLAGS=-g -O2" "CFLAGS_FOR_BUILD=-g -O2" "CFLAGS_FOR_TARGET=-g -O2" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "LDFLAGS=" "LIBCFLAGS=-g -O2" "LIBCFLAGS_FOR_TARGET=-g -O2" "MAKE=make" "MAKEINFO=makeinfo --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin/bash" "EXPECT=expect" "RUNTEST=runtest" "RUNTESTFLAGS=" "exec_prefix=/home/vagrant/opt/cross" "infodir=/home/vagrant/opt/cross/share/info" "libdir=/home/vagrant/opt/cross/lib" "prefix=/home/vagrant/opt/cross" "tooldir=/home/vagrant/opt/cross/i686-elf" "AR=ar" "AS=as" "CC=gcc" "CXX=g++" "LD=ld" "LIBCFLAGS=-g -O2" "NM=nm" "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" DO=all multi-do # make
make[1]: Leaving directory `/home/vagrant/src/build-gcc/zlib'
make[1]: Entering directory `/home/vagrant/src/build-gcc/libcpp'
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
make[1]: Leaving directory `/home/vagrant/src/build-gcc/libcpp'
make[1]: Entering directory `/home/vagrant/src/build-gcc/libdecnumber'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/vagrant/src/build-gcc/libdecnumber'
make[1]: Entering directory `/home/vagrant/src/build-gcc/fixincludes'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/vagrant/src/build-gcc/fixincludes'
make[1]: Entering directory `/home/vagrant/src/build-gcc/gcc'
make[1]: Leaving directory `/home/vagrant/src/build-gcc/gcc'
Checking multilib configuration for libgcc...
Configuring in i686-elf/libgcc
configure: loading cache ./config.cache
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/vagrant/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/vagrant/src/build-gcc/./gcc/xgcc -B/home/vagrant/src/build-gcc/./gcc/ -B/home/vagrant/opt/cross/i686-elf/bin/ -B/home/vagrant/opt/cross/i686-elf/lib/ -isystem /home/vagrant/opt/cross/i686-elf/include -isystem /home/vagrant/opt/cross/i686-elf/sys-include
checking for suffix of object files... configure: error: in `/home/vagrant/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
I have no idea what more to do. The binaries are all in the right place and seem to work, it's just libgcc that's failing. Since this is all on a vagrant debian box I'm considering wiping it and starting fresh.
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Trouble with cross compiler - "cannot compute suffix"

Post by iansjack »

User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Trouble with cross compiler - "cannot compute suffix"

Post by sortie »

Hi. When I asked for the commands and output above, I meant you must delete the build directory and start over. Paste all the terminal scrollback, including the commands you typed, in a single log.

Mind that the leading : in LD_LIBRARY_PATH means the current directory, it is a bad thing to do that.
Post Reply