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: cross compiling from platform PC-NT to M68040


Hello Jyrki!
Thank you for the hints you have sent me. I think the road to crossgcc on PC
is called trial and error. I appericiate the time you take to help out.
I have returned to this instruction you gave me and I wonder about the
folder tmp/crossgcc.
Do you make this folder in the same manner as the others src and build. I
tried to do that but when I come to the point
--target....  --prefix...
make
I get the respons "No targets specified and no makefile found". 

-----Original Message-----
From: Jyrki O Saarinen [mailto:jxsaarin@cs.Helsinki.FI]
Sent: den 18 april 2001 16:18
To: Johansson Mikael
Subject: RE: cross compiling from platform PC-NT to M68040



First you need to install cygwin in order to compile gcc. It is not
possible under mingw-gcc, at least very easily.

Then you need to donwload binutils source and gcc sources. What OS you are
planning to be using on the cross target? If it's now know by
gcc/binutils, you probably need to build newlib also (the standard C
library). If you an OS, it probably has libraries and includes already
built for m68k, so they just need to be placed to the cross-gcc
installation directory, so that gcc can find them when it's building it's
C support libraries.

The easiest way is not to use NT at all,  but some unix variant.
This is how I build a cross compiler to m68k-coff:

I downloaded the following files:
ftp.sunet.se/pub/gnu/gcc/gcc-2.95.3.tar.gz
ftp.sunet.se/pub/gnu/binutils/binutils-2.11.tar.gz
newlib-1.9.0.tar.gz

then I create two directories: /tmp/build and /tmp/src
I unpack all downloaded packages to /tmp/src.

Then I move /tmp/src/newlib-1.9.0/newlib to /tmp/src/gcc-2.95.3
so that the newlib gets built same time as gcc.

Then I copy /tmp/src/gcc-2.95.3/newlib/libc/include completely to the gcc
installation directory /tmp/crossgcc/m68k-coff so that gcc finds the
target environment includes when it builds the cross C standard libraries.

Now it's time to build binutils (linked, assembler, etc.):
cd /tmp/build
../src/binutils-2.11/configure --target=m68k-coff --prefix=/tmp/crossgcc
make
make install

now cross binutils are installed. then I add /tmp/crossgcc/bin to the path
so that gcc can find the cross assembler for example.

then the build directory is cleaned. now it's time to configure gcc:
../src/gcc-2.95.3/configure --target=m68k-coff --prefix=/tmp/crossgcc
--with-newlib
make
make install

now I have a working C, C++, Objective C, Fortran and Java compilers
running in i386-linux compiling programs to the 680x0 family.
(68000/68010, 5200, cpu32, 68020/68030, 68040 and 68060)

If you install cygwin, you can do this in NT too, but it's not guaranteed
that it will work. Usually it does, but when it doesn't it requires a huge
amount of hacking to fix the problem. A easier solution is to get a CD ROM
from a vendor I don't remember, but they have cygwin and pre-built
binaries for 21 different targets running on NT. Somebody mentioned the
company in comp.arch.embedded a while ago.

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