From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Edwards To: Atsumi Hirose Cc: ecos-discuss@sourceware.cygnus.com Subject: Re: [ECOS] building gcc-2.95.1 for eCos 1.2.1 Date: Thu, 04 Nov 1999 10:21:00 -0000 Message-id: <19991104122146.A24204@visi.com> References: <19991104031007.12225.rocketmail@web1706.mail.yahoo.com> <19991104084420.A14088@visi.com> X-SW-Source: 1999-11/msg00012.html 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