Problems crosscompiling 3.3.1 (CVS branch) from i386-linux to i686-pc-linux-gnu
Liviu Dudau
dliviu@ntlworld.com
Sun Jun 8 00:22:00 GMT 2003
Hello,
After all the nice things that started to appear in 3.3 branch of gcc, I
launched on a project to build
a GNU/Linux system tailored to my CPU. As a first step, I'm trying to
build a crosscompiler from my
i386-linux environment (Debian testing) to a i686-pc-linux-gnu target
using the 3.3 CVS branch.
However, building the bootstrap c compiler fails misserably with:
make[2]: Entering directory `/opt/temp/obj/gcc-3.3.1/gcc'
for d in libgcc; do \
if [ -d $d ]; then true; else /bin/sh
../../../src/gcc-3.3.1/gcc/mkinstalldirs $d; fi; \
done
mkdir libgcc
if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi
/opt/temp/obj/gcc-3.3.1/gcc/xgcc -B/opt/temp/obj/gcc-3.3.1/gcc/
-B/opt/temp/build/cross/i686-pc-linux-gnu/bin/
-B/opt/temp/build/cross/i686-pc-linux-gnu/lib/ -isystem
/opt/temp/build/cross/i686-pc-linux-gnu/include -O2 -DIN_GCC
-DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -isystem ./include -fPIC -g -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I.
-I../../../src/gcc-3.3.1/gcc -I../../../src/gcc-3.3.1/gcc/.
-I../../../src/gcc-3.3.1/gcc/config
-I../../../src/gcc-3.3.1/gcc/../include -DL_muldi3 -c
../../../src/gcc-3.3.1/gcc/libgcc2.c -o libgcc/./_muldi3.o
In file included from tconfig.h:23,
from ../../../src/gcc-3.3.1/gcc/libgcc2.c:36:
../../../src/gcc-3.3.1/gcc/config/i386/linux.h:232:20: signal.h: No such
file or directory
../../../src/gcc-3.3.1/gcc/config/i386/linux.h:233:26: sys/ucontext.h:
No such file or directory
make[2]: *** [libgcc/./_muldi3.o] Error 1
as the first thing (I think) when it tries to build stage1. The
configure command was:
CFLAGS="-O2 -Dinhibit_libc" ../../src/gcc-3.3.1/configure
--prefix=/opt/temp/build/cross --host=i386-linux
--target=i686-pc-linux-gnu --disable-nls --disable-shared
--disable-multilib --enable-threads=single --enable-__cxa_atexit
--enable-languages=c --with-gnu-as
--with-as=/opt/temp/build/cross/bin/i686-pc-linux-gnu-as --with-gnu-ld
--with-ld=/opt/temp/build/cross/bin/i686-pc-linux-gnu-ld
--with-cpu=athlon_xp --with-schedule=athlon_xp --with-tune=athlon_xp
--with-sysroot=/opt/temp/build/cross/i686-pc-linux-gnu/include/linux
Trying --with-sysroot=/opt/temp/build/cross/i686-pc-linux-gnu/include
(where the linux, asm and asm-i386 directories reside) does not change
the error. I can provide full logs on request.
The snipet right after it finished building xgcc1:
gcc -DIN_GCC -DHAVE_CONFIG_H -g -DIN_GCC -DCROSS_COMPILE -W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional
-pedantic -Wno-long-long -DHAVE_CONFIG_H -DGENERATOR_FILE -W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional
-pedantic -Wno-long-long -I. -I..
-I../../../../src/gcc-3.3.1/gcc/fixinc
-I../../../../src/gcc-3.3.1/gcc/fixinc/..
-I../../../../src/gcc-3.3.1/gcc/fixinc/../config
-I../../../../src/gcc-3.3.1/gcc/fixinc/../../include -o fixincl
fixincl.o fixtests.o fixfixes.o server.o procopen.o gnu-regex.o fixlib.o
../../libiberty/libiberty.a
echo timestamp > full-stamp
./fixincl -v < /dev/null
'fixincl version 1.1'
chmod 755 ../fixinc.sh
make[3]: Leaving directory `/opt/livian/obj/gcc-3.3.1/gcc/fixinc'
rm -rf include; mkdir include
chmod a+rx include
(TARGET_MACHINE='i686-pc-linux-gnu'; srcdir=`cd
../../../src/gcc-3.3.1/gcc; ${PWDCMD-pwd}`; \
SHELL='/bin/sh' ;\
export TARGET_MACHINE srcdir SHELL ; \
/bin/sh ./fixinc.sh `${PWDCMD-pwd}`/include
/opt/livian/build/cross/i686-pc-linux-gnu/sys-include ; \
rm -f include/syslimits.h; \
if [ -f include/limits.h ]; then \
mv include/limits.h include/syslimits.h; \
else \
cp ../../../src/gcc-3.3.1/gcc/gsyslimits.h include/syslimits.h; \
fi; \
chmod a+r include/syslimits.h)
Fixing headers into /opt/livian/obj/gcc-3.3.1/gcc/include for
i686-pc-linux-gnu target
if [ "/opt/livian/build/cross/i686-pc-linux-gnu/sys-include" =
"/opt/livian/build/cross/i686-pc-linux-gnu/sys-include" ] \
&& [ -d /opt/livian/build/cross/i686-pc-linux-gnu/sys-include ]; then \
if [ -d /opt/livian/build/cross/lib ] ; then true ; else mkdir
/opt/livian/build/cross/lib ; fi; \
if [ -d /opt/livian/build/cross/lib/gcc-lib ] ; then true ; else mkdir
/opt/livian/build/cross/lib/gcc-lib; fi; \
if [ -d /opt/livian/build/cross/lib/gcc-lib/i686-pc-linux-gnu ] ; then
true ; else mkdir /opt/livian/build/cross/lib/gcc-lib/i686-pc-linux-gnu
; fi; \
if [ -d /opt/livian/build/cross/lib/gcc-lib/i686-pc-linux-gnu/3.3.1 ]
; then true ; else mkdir
/opt/livian/build/cross/lib/gcc-lib/i686-pc-linux-gnu/3.3.1 ; fi; \
else true; fi
echo timestamp > stmp-fixinc
if [ -f /opt/livian/build/cross/i686-pc-linux-gnu/sys-include/limits.h ]
; then \
cat ../../../src/gcc-3.3.1/gcc/limitx.h
../../../src/gcc-3.3.1/gcc/glimits.h ../../../src/gcc-3.3.1/gcc/limity.h
> tmp-xlimits.h; \
else \
cat ../../../src/gcc-3.3.1/gcc/glimits.h > tmp-xlimits.h; \
fi
mv tmp-xlimits.h xlimits.h
if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
for file in .. ../../../src/gcc-3.3.1/gcc/ginclude/float.h
../../../src/gcc-3.3.1/gcc/ginclude/iso646.h
../../../src/gcc-3.3.1/gcc/ginclude/stdarg.h
../../../src/gcc-3.3.1/gcc/ginclude/stdbool.h
../../../src/gcc-3.3.1/gcc/ginclude/stddef.h
../../../src/gcc-3.3.1/gcc/ginclude/varargs.h
../../../src/gcc-3.3.1/gcc/unwind.h
../../../src/gcc-3.3.1/gcc/config/i386/mmintrin.h
../../../src/gcc-3.3.1/gcc/config/i386/xmmintrin.h; do \
if [ X$file != X.. ]; then \
realfile=`echo $file | sed -e 's|.*/\([^/]*\)$|\1|'`; \
echo timestamp > include/$realfile; \
rm -f include/$realfile; \
cp $file include; \
chmod a+r include/$realfile; \
fi; \
done
rm -f include/limits.h
cp xlimits.h include/limits.h
chmod a+r include/limits.h
rm -f include/README
cp ../../../src/gcc-3.3.1/gcc/README-fixinc include/README
chmod a+r include/README
Now the questions:
1) which version of signal.h is gcc trying to find here? Looking at my
Debian system, there is a /usr/include/signal.h coming from glibc, and a
/usr/include/linux/signal.h coming from the kernel. If it is the linux
version, why not use the <linux/signal.h> in the i386/linux.h file?
2) what do I do wrong here? Am I missleaded? Any hints will be gladly
appreciated.
3) why doesn't the configuration step for stage1 obey the
--with-sysinclude option?
4) OT: even with all those options, the genattrtab always chooses the
'pentium' and 'pentium_fpu' Automaton. Any idea on how to change that?
Sorry for the long post. Any answers will be welcome.
Many thanks,
Liviu
More information about the Gcc
mailing list