This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cross-compiler intel -> powerpc-gnu-linux


Bill,

   This looks like a good setup -- but it doesn't work for me.  I'm playing around with it now,
maybe I can figure something out.  What is the difference between the gcc-core and gcc
distributions?  I thought maybe that would help, but it hasn't.

   My main problem with your instructions is that when building gcc it can't find include files
like stdlib.h and unistd.h.  This happens when compiling libgcc2.c, while building gcc.  You didn't
reference any 'with-headers=' line on your gcc configure example.  Did you really get it to work
without one?

   The main issue, it seems, is that to build gcc certain header files must be found.  These seem
to live in the glibc distribution, but in a funny place.  i.e. the stdlib.h file that is in the
glibc/include directory merely includes <stdlib/stdlib.h> and there are a number of other examples
like that.  It sort of appears that glibc needs to be built first (or re-structured somehow) before
the gcc build can use its include files.  Maybe gcc shouldn't be using glibc's include files, but
if not, I don't know how to resolve the stdlib.h, etc references in libgcc2.c

bob

On 13-Jun-00 Bill Webster wrote:
> These are the steps that I followed to build the cross-compiler I am currently using (I am
> reasonably
> certain that these are quite complete):
> 
># Packages:
>#   binutils-2.9.5.0.46.tar.gz
>#   gcc-core-2.95.2.tar.gz
>#   linux-2.2.15.tar.gz
>#   glibc-2.1.3.tar.gz
>#   glibc-crypt-2.1.tar.gz
>#   glibc-linuxthreads.2.1.3.tar.gz
>#
> 
># Unpackage source
> 
># Set up some environment vars
> host=i686-linux
> target=powerpc-linux
> prefix=/opt/test
> tprefix=${prefix}/${target}
> bin=${prefix}/bin
> binutils=../binutils-2.9.5.0.46
> gcc=../gcc-2.95.2
> glibc=../glibc-2.1.3
> kernel=../linux-2.2.15
> 
># Do some cleanup (if necessary) and prep work
> rm -fr binutils-build gcc-build glibc-build
> mkdir binutils-build gcc-build glibc-build
> 
># Build tool chain
> cd ${base}/binutils-build
> ${binutils}/configure --srcdir=${binutils} --prefix=${prefix} --target=${target}
> make all
> <make install>
> 
> cd ${base}/gcc-build
> ${gcc}/configure --srcdir=${gcc} --prefix=${prefix} --target=${target}
> export PATH=${bin}:${PATH}
> make all
> <make install>
> 
># Install kernel headers
> <cd ${kernel}>
># Edit ${kernel}/Makefile, change line 'ARCH := ...' to 'ARCH := ppc'
> <make menuconfig>
># In 'Platform support' select correct 'Processor type' and 'Machine type' and exit
># with save
> <make dep>
># Copy kernal include files into tool chain install directory
> <cp -dR ${kernel}/include/asm-ppc ${tprefix}/include/asm>
> <cp -dR ${kernel}/include/linux ${tprefix}/include/linux>
> 
># Finish tool chain
> cd ${base}/glibc-build
> CC=${target}-gcc
> ${glibc}/configure --srcdir=${glibc} --prefix=${tprefix} --build=${host}
> --enable-add-ons=crypt,linuxthreads --with-headers=${tprefix}/include ${target}
> make all
> <make install>
> 
> All of the steps that are enclosed in '<...>' are steps which are performed while logged in as
> root.

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]