I just went through this process for ia32 to ia64 cross. I will attach a script that will possibly help you out. I found it on the net and have heavily modified it. I am currently doing work with gcc-3.2.3 but it has worked in the past for 2.95. Also take a look at the CrossGCC FAQ http://www.objsw.com/CrossGCC/FAQ.html Lew Newby Jr. Sr. Linux Architect SACC Inc. Office: (740)454-8778 Fax: (740)454-8778 Mobile: (740)819-1615 lnewby@xxxxxxxxxxx or gideon@xxxxxxxx -----Original Message----- From: Bob Beck [mailto:beck@xxxxxxxxxxxxx] Sent: Wednesday, February 11, 2004 11:40 PM To: gcc-help@xxxxxxxxxxx Subject: GCC 2.95.3 cross compiler build error looking for stubs.h I am building GCC as a cross compiler for the PowerPC. The instructions I am following are from O'Reilly's "Building Embedded Systems" book. At a high level I have done the following. o Configure the kernel (2.4.18) using make menuconfig o Copy kernel header files to gcc build area o Build binutils 2.10.1 o Build the bootstrap GCC compiler ../gcc-2.95.3/configure --target=powerpc --prefix=$HOME/tools \ --without-headers --with-newlib --enable-language=c o Build C library with linux threads support CC=powerpc-linux-gcc ../glibc-2.2.1/configure --host=powerpc --prefix="/usr" --enable-add-ons --with-headers=$HOME/tools/powerpc-linux o Build Full GCC compiler ../gcc-2.95.3/configure --target=powerpc --prefix=$HOME/tools \ --enable-languages=c,c++ Now the error. It looks like a file has been generated by the configure script that includes "features.h" in the glibc tree. Since _LIBC is not defined, another include "gnu/stubs.h" is attempted. However, since there is no file "stubs.h", the build fails. Does anybody have any suggestions ? ---------------------------------------------- Actual Error ---------------------------------------------- /home/bob/pathfinder-mp/build-tools/build-gcc/gcc/xgcc -B/home/bob/pathfinder-mp/build-tools/build-gcc/gcc/ -B/home/bob/pathfinder-mp/tools/powerpc-linux/bin/ -I/home/bob/pathfinder-mp/tools/powerpc-linux/include -O2 -DCROSS_COMPILE -DIN_GCC -DHAIFA -g -O2 -I./include -fPIC -g1 -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -mstrict-align -I. -I../../gcc-2.95.3/gcc -I../../gcc-2.95.3/gcc/config -I../../gcc-2.95.3/gcc/../include -c -DL${name} \ ../../gcc-2.95.3/gcc/libgcc2.c -o ${name}.o; \ if [ $? -eq 0 ] ; then true; else exit 1; fi; \ powerpc-linux-ar rc tmplibgcc2.a ${name}.o; \ rm -f ${name}.o; \ done _muldi3 In file included from /home/bob/pathfinder-mp/tools/powerpc-linux/include/stdlib.h:25, from ../../gcc-2.95.3/gcc/libgcc2.c:41: /home/bob/pathfinder-mp/tools/powerpc-linux/include/features.h:311: gnu/stubs.h: No such file or directory make[3]: *** [libgcc2.a] Error 1 make[3]: Leaving directory `/home/bob/pathfinder-mp/build-tools/build-gcc/gcc' make[2]: *** [stmp-multilib-sub] Error 2 make[2]: Leaving directory `/home/bob/pathfinder-mp/build-tools/build-gcc/gcc' make[1]: *** [stmp-multilib] Error 1 make[1]: Leaving directory `/home/bob/pathfinder-mp/build-tools/build-gcc/gcc' make: *** [all-gcc] Error 2 [bob@budweiser build-gcc]$
Attachment:
build-crossgcc.sh
Description: build-crossgcc.sh