This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

Re: i686-linux to sparc-sun-solaris2.5.1 cross compile problems


On Sun, 28 Oct 2001 07:07:37 -0800
David Thompson <David.Thompson@efi.com> wrote:

> Hi,
> 
> For my cross compiler sun -> linux build, I learned
> to ignore the 'cannot create executable' error.  It
> is misleading, dare I say, I think it is stupid of
> for the configure/makefile to try to execute a test
> program for target system on the build system, it is
> obvious that a sparc executable *cannot* be executed
> on your linux box, so this error message is trying to
> tell you that your cross compiler failed to produce
> an executable that could run on your native host.
> 
> Well, duh!  <Pardon my sarcasm, someone please correct
> me if I'm wrong.>  Whomever wrote that it into the
> Makefile had a screw loose.
> 
> Try using make -i to get past this.
> 
> Also you need the *target* header files!  Thus, you need
> to get the sparc header files and make them available to
> your build.  Yes, it makes a difference!  Do NOT use the
> linux headers when producing a sparc cross-compiler, it
> looks like you did that part wrong.
> 
> Here is my script I used to build my sun->linux and
> sgi->linux cross compilers.  It might help you some.
> It took me alot to get this right.  Every detail in
> this script is critical, esp like setting up your
> PATH correctly.
> 
> For *my* build in this script,
> I copied the /usr/include and /usr/lib directories
> of a linux box to /home/davidt/gnu, and then used the
> --with-libs and --with-headers options.
> 
> For your script, you'll need to copy the /usr/include
> and /usr/lib from sparc to a location on your linux
> box and use these two options to point to them.
> 
> Here is my script, though it is not exactly a solution
> for you, it should provide you some ideas,
> 
> --begin-script--
> #!/bin/sh
> 
> GCC=gcc-2.95.3
> BINUTILS=binutils-2.10.1
> TARGET=i686-pc-linux-gnu
> 
> case `uname -s` in
>     IRIX*) PLATFORM=mips-sgi-irix6.5 ;;
>     SunOS) PLATFORM=sparc-sun-solaris2.7 ;;
>     *)     echo "Unknown platform" ; exit 1 ;;
> esac
> 
> TARDIR=$HOME/gnu/tar
> SRCDIR=$HOME/gnu/xdev/src/$PLATFORM
> PREFIX=$HOME/gnu/xdev/$PLATFORM
> 
> PATH=$PREFIX/bin:/usr/local/bin:$PATH
> export PATH
> 
> mkdir -p $SRCDIR
> 
> cd $SRCDIR
> tar zxf $TARDIR/$BINUTILS.tar.gz
> tar zxf $TARDIR/$GCC.tar.gz
> 
> ## -- build cross binutils for linux
> cd $SRCDIR/$BINUTILS
> ./configure --target=$TARGET --prefix=$PREFIX
> make
> make install
> 
> ## -- build cross gcc for linux
> cd $SRCDIR/$GCC
> ./configure --target=$TARGET --prefix=$PREFIX \
> --enable-languages=c,c++ --enable-shared --enable-threads \
> --with-as=$PREFIX/bin/$TARGET-as --with-ld=$PREFIX/bin/$TARGET-ld \
> --with-headers=/home/davidt/gnu/usr/include \
> --with-libs=/home/davidt/gnu/usr/lib
> make -i
> make install
> --end-script--
> 
> Also, Bill Gatliff has an excellent FAQ, you should find
> his URL and read it.
> 
> Since I was a newbie a few short months ago, I'm very
> much aware that building a cross-compiler is a black art.
> 
> It shouldn't be this hard ...
> 
> --
> David
> 

Thanks a lot my frient! You were absolutely correct! Well now I have
another small problem... :-( I have a directory about 60MB of software
that produces software I cannot run on linux but I cannot make it compile
anything :-( I tried using --target=... on  configure but it configures
everything to use my normal gcc. What more does it want? Thanks again!

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