This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
Re: building gcc-2.95.1 for eCos 1.2.1
I previously wrote:
> One of the things I'm going to do during the next few days is try to
> repeat the build process I used and document exactly what I had to do
> to get gcc to build.
Here's a link with a lot of useful information:
http://www.objsw.com/CrossGCC/
Some of it is specific to older versions of gcc, but much of it is still useful.
Building a cross-compiler for an embedded system isn't quite as bad as it seemed
the first time through the process. The steps I used to build an ARM compiler on
my Linux (RH6.0) system are:
1) Build and install gdb.
Follow the standard instructions after configuring with
--target=arm-elf --program-prefix=arm-elf-
That should result in a program named arm-elf-gdb being installed in
/usr/local/bin.
2) Build and install binutils.
Follow the standard instructions after configuring with
--target=arm-elf --program-prefix=arm-elf-
That should result in programs named arm-elf-as, arm-elf-ld, etc. installed
in /usr/local/bin.
At this point you should be able to assemble and link a program. You
should be able to load the program into your target and run it with
gdb. If not, then building gcc isn't going to be of much use. ;)
3) Build and install a gcc cross compiler.
a) Configure with --target=arm-elf --program-prefix=arm-elf-
b) The build process for libgcc will try to use an assembler at
/usr/local/arm-elf/bin/as.
Make that a symbolic link to /usr/local/bin/arm-elf-as.
c) Do "make all-gcc"
This should build the compiler itself and libgcc.a.
If you just do a "make", it will try to build a wagon-load of stuff
that will fail: libio, libg++, whatever.
d) Do "make install-gcc"
This should install the compiler shell as
/usr/local/bin/arm-elf-gcc and the rest of the stuff under
/usr/local/lib/gcc-lib/arm-elf/2.95.1.
At this point you should be able to compile a program with arm-elf-gcc.
NB: The default output from ARM targeted tools is little-endian. Therefore,
the libgcc.a created by step 3c) is little-endian. I had to
rebuild mine since I have big-endian hardware. Next, I'll try to
document the easiest way to do that.
--
Grant Edwards
grante@visi.com