cross compiler Sparc-Solaris -> PowerPc

Brendan J Simon Brendan.Simon@ctam.com.au
Sat Apr 1 00:00:00 GMT 2000


Dumortier wrote:

> >> 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'
> >> ********************************************************************

I don't know why gcc is trying to configure libchill.  As far as I know this
shouldn't happen if you configure with --enable-languages="c".  I think this is
your problem.  Please double check the spelling of enable-languages="c" to make
sure there is no typo error.  If this is OK, then I would suggest removing the
libchill directory or just renaming it to something else.


> >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"
> ############################################################################
> ######
>
> Ok : I did the following configuration :
>
> ../gcc-2.95.2/configure --target=powerpc-eabi --prefix= /local/ppc \
> --with-gnu-as --with-gnu-ld --with-newlib \ --enable-languages="c"
> --with-headers=~/gnu/newlib-1.8.2/newlib/libc/include -v

I don't think you need the --with-headers option if you use --with-newlib.  If
you put a symbolic link from the newlib source to your gcc source direcory.  ie.
ln -s ~/gnu/newlib-1.8.2 newlib.
I don't know if this will make any difference though.  Your configure command
should still work.


> 2) "make all install" should install the cross compiler.
> Yes, it has been installed without errors.

Good.
I'm not sure if the startup files for the ads, sim and yellowdog targets are part
of gcc or part of newlib.  I think they are part of newlib.  newlib needs to be
built and installed and you should find crt0.o, sim-crt0.o, libads.a, libsim.a,
libmbx.a, libyk.a, etc in $prefix/$target/lib.

The specs file found in $prefix/lib/gcc-lib/$target/$version specifies which
libraries and startup files to use.  The default is to use none and that is why
you get your linker errors.  Specifying -mads tells gcc to link with crt0.o and
libads.a.  You have to specify these manually on the gcc or ld command line.
Alternatively, you can modify the specs file to use the target startup files and
libraries that you want.


> But... I have some doubts concerning the crt0.o file. When I 'make' the
> gcc, I had one that I picked up on an other computer to put it in
> target/lib directory. Now, I've done the following thing :
> - I notice there was a crt0.S file in newlib-1.8.2/libgloss/rs6000/
> - I preprocessed it : "cpp crt0.S crt0.s" (with the cross-preprocessor)
> - I assemble it : "as -o crt0.o crt0.s (with the cross-assembler)
> - and I put the result in "target/lib" instead of the other file
>
> Does it make sens?

Yes.


> ############################################################################
> ########
> 3) now configure, build and install newlib as described in the newlib docs.
> ############################################################################
> ########
>
> ../newlib-1.8.2/configure --target=powerpc-eabi --prefix= /local/ppc
> Ok, no errors

There is an error here !!!!
The --prefix option is wrong !!!  It should be --prefix=/local/ppc/$target.  ie.
/local/ppc/powerpc-eabi.

This should hopefully fix your problems.

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



More information about the crossgcc mailing list