cross compile errors with several gcc versions

Dennis Heuer dh@triple-media.com
Sun Mar 26 02:19:00 GMT 2006


Hello,

I tried to compile a native 64bit system for my Sempron64 but failed
to compile the cross compiler on my own source-based system, on Ubuntu
64bit (which takes 2h for building insn-attrtab.o), and with several
versions of binutils, glibc, newlib, and gcc. I also tried out new
binutils and gcc for my build system.

The configure options for all packages were:

./configure --prefix=/opt/cross --target=x86_64-*-linux-gnu -v

I tried --with-newlib and --without-headers too. For glibc I used
--enable-kernel=2.6 and --with-tls.

gcc 4.1.0 showed a small extra error in 'host-i686-pc-linux-gnu/gcc':

In file included from ./tm.h:4,
                 from ../.././gcc/genmddeps.c:21:
./options.h:516: error: expected ',' or '}' before '-' token
make[2]: *** [build/genmddeps.o] Error 1
make[2]: Leaving directory

I changed '-' to '_' and it worked.

The next error appeared with all tested versions (down to gcc 3.4.6):

<gcc-x.x.x>/host-i686-pc-linux-gnu/gcc/xgcc
-B/Archiv/Prozessoren/languages/gcc-4.1.0/host-i686-pc-linux-gnu/gcc/
-B/opt/cross/x86_64-*-linux-gnu/bin/
-B/opt/cross/x86_64-*-linux-gnu/lib/
-isystem /opt/cross/x86_64-*-linux-gnu/include
-isystem /opt/cross/x86_64-*-linux-gnu/sys-include -O2  -O2   -DIN_GCC
-DCROSS_COMPILE -DNATIVE_CROSS   -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../.././gcc
-I../.././gcc/. -I../.././gcc/../include
-I../.././gcc/../libcpp/include  -fexceptions -fvisibility=hidden
-DHIDE_EXPORTS -c ../.././gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o
In file included from ./gthr-default.h:1,
from ../.././gcc/gthr.h:114,
from ../.././gcc/unwind-dw2.c:42:
../.././gcc/gthr-posix.h:43:21:
error: pthread.h: No such file or directory
../.././gcc/gthr-posix.h:44:20:
error: unistd.h: No such file or directory

I was able to solve this by appending -I/opt/cross/include to
all xgcc lines in the Makefile in gcc-4.1.0/host-i686-pc-linux-gnu/gcc

The next error I can't solve:

gcc    -DIN_GCC -DCROSS_COMPILE -DNATIVE_CROSS  -W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic
-Wno-long-long -Wno-variadic-macros -Wold-style-definition
-Wmissing-format-attribute    -DHAVE_CONFIG_H -I. -I. -I../.././gcc
-I../.././gcc/. -I../.././gcc/../include
-I../.././gcc/../libcpp/include     \ -DPREFIX=\"/opt/cross\"
-DBASEVER="\"4.1.0\"" \ -c ../.././gcc/prefix.c -o
prefix.o
/tmp/cctd8T18.s: Assembler messages:
/tmp/cctd8T18.s:17: Error: suffix or operands invalid for `push' 
/tmp/cctd8T18.s:52: Error: suffix or operands invalid for `push' 
/tmp/cctd8T18.s:54: Error: suffix or operands invalid for `push' 
/tmp/cctd8T18.s:55: Error: suffix or operands invalid for `push' 
/tmp/cctd8T18.s:75: Error: suffix or operands invalid for `pop' 
/tmp/cctd8T18.s:76: Error: suffix or operands invalid for `pop' 
/tmp/cctd8T18.s:77: Error: suffix or operands invalid for `pop' 
/tmp/cctd8T18.s:82: Error: suffix or operands invalid for `push' 
/tmp/cctd8T18.s:182: Error: suffix or operands invalid for `push' 
/tmp/cctd8T18.s:202: Error: suffix or operands invalid for `pop' 
/tmp/cctd8T18.s:212: Error: suffix or operands invalid for `push' 
/tmp/cctd8T18.s:214: Error: suffix or operands invalid for `push' 
/tmp/cctd8T18.s:412: Error: suffix or operands invalid for `pop' 
/tmp/cctd8T18.s:413: Error: suffix or operands invalid for `pop' 
/tmp/cctd8T18.s:419: Error: suffix or operands invalid for `push'
make[2]: *** [prefix.o] Error 1 make[2]: Leaving directory
<gcc-x.x.x>host-i686-pc-linux-gnu/gcc'
make[1]: *** [all-gcc] Error 2 make[1]: Leaving directory

Can you help further?

Dennis



More information about the Gcc-bugs mailing list