Help w/ gcc cross build failing
Harry Kaes
harry.kaes@agfa.com
Fri Aug 27 09:48:00 GMT 2004
>Hi -
>
>I'm trying to build a GCC 3.4.1 crosscompiler hosted on a Win2K PC
(building under Cygwin) with a
>powerpc-*-eabi target (need to support PPC750, PPC74xx, MPC82xx, &
MPC85xx). When I looked on
>the GCC 3.4 project web site it didn't appear that anyone else has
reported building the powerpc-*-eabi.
>
>I've already built the bin-utils (2.14) for powerpc-eabi and they appear
to be working.
>
>When I build GCC I get an error building genmodes.o. The error from xgcc
appears to be that it can't find
>stdio.h and several other headers that are included by
...\gcc-3.4.1\gcc\system.h. What isn't clear to me
>is which version of stdio.h *should* be used. I tried editing the
makefile to use the headers in /usr/local,
>but that caused linker errors down the line. I also found a couple of
copies of stdio.h in the source tree of
>the distribution I downloaded from gcc.gnu.org but I can't find one in
any of the places the compiler
>appears to be searching for.
>
>Any ideas about what I should do next? Is there a step I'm missing? Below
is the output of the make log
>that I get when the build fails...
>
Hi Jon,
A few months ago I was trying to build a cross compiler for the mips
target. It took me a few days and a lot of help from the crosgcc mailing
list to get it to build, but finally I succeeded (I succeeded to build it
in separate steps, and also by using the crosstool of Dan, by changing
some files, which Dan included in his release). Shortly after, we started
to use a powerpc processor, so I started to build the gcc compiler for the
powerpc. This took a lot less effort because I used about the same
procedure as for building the mips cross compiler. Anyway, here are the
steps I used :
First step : building binutils. The sources were unzipped in a directory
binutils-2.14. I created a directory build-binutils-powerpc from which the
configure and make were run.
In directory build-binutils-powerpc : ../binutils-2.14/configure
--target=powerpc-eabi --host=i686-pc-cygwin --build=i686-pc-cygwin
--prefix=/gcc-powerpc
after configure is done, in the same directory I started make like this :
make all install.
After this step, I added the <prefix> directory to the PATH so that cygwin
can find the newly created binutils. I did this in a file called
'cygwin/etc/profile'. In this file you can see some paths which are added
to the PATH variable. I simply added mine in the same manner, and the
resulting line was
´PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/gcc-powerpc/bin:$PATH"´
as my prefix directory was gcc-powerpc. Remember to restart your cygwin
window for the changes to have effect.
Second step : making bootstrap gcc. The sources were unzipped in directory
gcc-3.3.3. I created a directory build-gcc-powerpc from which the
configure and make were run.
In directory build-gcc-powerpc : ../gcc-3.3.3/configure
--target=powerpc-eabi --host=i686-pc-cygwin --build=i686-pc-cygwin
--prefix=/gcc-powerpc --without-headers --with-newlib
after configure is done, in the same directory I started make like this :
make all-gcc install-gcc.
Third step : building the newlib libraries. The sources were unzipped in
directory newlib-1.12.0. I created a directory build-newlib-powerpc from
which the configure and make were run.
In directory build-newlib-powerpc : ../newlib-1.12.0/configure
--target=powerpc-eabi --host=i686-pc-cygwin --build=i686-pc-cygwin
--prefix=/gcc-powerpc
after configure is done, in the same directory I started make like this :
make all install.
Fourth step : making the complete cross compiler. Using the same sources
in gcc-3.3.3 as for the bootstrap gcc, I created a directory
build-gcc-final-powerpc for the configure and make step.
In directory build-gcc-final-powerpc : ../gcc-3.3.3/configure
--target=powerpc-eabi --host=i686-pc-cygwin --build=i686-pc-cygwin
--prefix=/gcc-powerpc --enable-languages=c
make all install.
I did not succeed in creating a cross compiler for c++, but as I for the
time being I don't really need c++ I did not put any further effort in
that step.
I hope this is of some help.
Harry Kaes
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list