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 Sparc-Solaris -> PowerPc


Johann Dumortier wrote:

> Hi all crossgcc suscribers!
>
> As the title mentions it, I would like to build a cross compiler for a Powerpc
> target.
>
> So,
> -I downloaded every GNU Tools,
> -configured and installed binutils
> -configured gcc but when I wanted to make it, (I proceed exactly as it was
> described in the mail from Janne Andersson that I would like to thank for all
> the details of her progression!)  I got the following fatal error after 3-4
> hours compilation :
>
> ********************************************************************
> `iostream.list' is up to date.
> cd tests; make all ...
> cd testsuite; make all ...
> cd tests; make all ...
> cd testsuite; make all ...
> Configuring in powerpc-eabi/libchill
> loading cache ./config.cache
> checking if compiler cc1chill has been built... yes
> checking for gcc... /local/cross/build-gcc/gcc/xgcc
> -B/local/cross/build-gcc/gcc/ -B/local/ppc/powerpc-eabi/bin/ -idirafter
> /local/cross/build-gcc/powerpc-eabi/newlib/targ-include -idirafter
> /local/cross/gcc-2.95.2/newlib/libc/include -nostdinc
> checking whether the C compiler (/local/cross/build-gcc/gcc/xgcc
> -B/local/cross/build-gcc/gcc/ -B/local/ppc/powerpc-eabi/bin/ -idirafter
> /local/cross/build-gcc/powerpc-eabi/newlib/targ-include -idirafter
> /local/cross/gcc-2.95.2/newlib/libc/include -nostdinc -g -O2 ) works... no
> configure: error: installation or configuration problem: C compiler cannot
> create executables.
> *** Error code 1
> make: Fatal error: Command failed for target `configure-target-libchill'
> ********************************************************************
>
> Does anyone know a possible reason of this error ( C compiler cannot create
> executables)and give me an hint on it ?

I think this is because the non C compilers rely on the C compiler being
installed with the C libraries.  You can't build and install the C libraries
without first building and installing the C compiler.

1) configure with "--enable-languages="c"
2) "make all install" should install the cross compiler.
3) now configure, build and install newlib as described in the newlib docs.
4) check that your cross compiler can build executables.  eg. gcc -o hello.elf
hello.c
If this fails during the link it is probably because you haven't specified a
startup file and routines for your embedded system.  For powerpc targets just use
the -mads option for now.  ie. gcc -mads -o hello.elf hello.c
You should get no errors and a hello.elf file should be produced.
5) now go back and configure gcc with the languages you want.  eg
--enable-languages="c,c++", build and install should work.  Having no
enable-languages option should build all the compilers.

You can try something simple to avoid step 1 and 2 again.  Just type "make
install" and you will probably find that the C compiler gets installed but the
others fail to install as they were not able to be built.  You don't really care
about them at this stage.  As long as the C compiler installs, you will be able
to proceed and compile the C libraries (newlib).

Brendan Simon.



------
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]