This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Tutorial 3
- From: Peter Barada <pbarada at mail dot wm dot sps dot mot dot com>
- To: M_J_BUTCHER at compuserve dot com
- Cc: gcc-help at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Mon, 17 Jun 2002 12:31:05 -0400
- Subject: Re: Tutorial 3
- References: <200206161840_MC3-1-294-7AE@compuserve.com>
>Here an update of my weary journey from innocent and gullable PC user to
>hardened, grey-haired GCC cross-compiler guru. Actually the journey
>probably has not yet reached further than the end of the garden path and I
>must still be making some kind of beginners errors - but its hope that
>drives me on.
You've obviously persisted long enough to get close to your goal! To
help you get there I've just built up a gcc-3.0.4 version configured
for mcore-elf(can't run it, don't have hardware), and I found that I
had to modify gcc/config/mcore/mcore.h:
Index: mcore.h
===================================================================
RCS file: /usr/local/wavemark/cvs/archives/cross-linux-tools/gcc-304/gcc/config/mcore/mcore.h,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 mcore.h
*** mcore.h 2002/03/04 18:05:08 1.1.1.1
--- mcore.h 2002/06/17 16:16:55
***************
*** 185,191 ****
/* The MCore ABI says that bitfields are unsigned by default. */
/* The EPOC C++ environment does not support exceptions. */
! #define CC1_SPEC "-funsigned-bitfields %{!DIN_GCC:-fno-rtti} %{!DIN_GCC:-fno-exceptions}"
/* What options are we going to default to specific settings when
-O* happens; the user can subsequently override these settings.
--- 185,191 ----
/* The MCore ABI says that bitfields are unsigned by default. */
/* The EPOC C++ environment does not support exceptions. */
! #define CC1_SPEC "-funsigned-bitfields"
/* What options are we going to default to specific settings when
-O* happens; the user can subsequently override these settings.
Which drops the -fno-rtti and -fno-exceptions from the command
line(needed to configure libcstd++v3).
To build it, I used binutils-2.12(20020222), gcc-3.0.4, newlib-1.9.0,
gdb-5.1, and a slightly tweaked crossgcc.sh script that Bill Gatliff
wrote. Here's the following config.status results in the order of the
construction:
binutils:
#!/bin/sh
# This file was generated automatically by configure. Do not edit.
# This directory was configured as follows:
/home/pbarada/work/cvs-wavemark/cross-linux-tools/binutils-2/configure --host=i686-pc-linux-gnu --target=mcore-elf --prefix=/tmp/crap --norecursion
#
gcc-bootstrap:
#!/bin/sh
# This file was generated automatically by configure. Do not edit.
# This directory was configured as follows:
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-304/configure --with-gcc-version-trigger=/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-304/gcc/version.c --host=i686-pc-linux-gnu --target=mcore-elf --prefix=/tmp/crap --enable-languages=c --with-local-prefix=/tmp/crap/mcore-elf --without-headers --with-newlib --disable-shared --verbose --norecursion
#
newlib:
#!/bin/sh
# This file was generated automatically by configure. Do not edit.
# This directory was configured as follows:
/home/pbarada/work/cvs-wavemark/cross-linux-tools/newlib-1.9.0/configure --host=i686-pc-linux-gnu --target=mcore-elf --prefix=/tmp/crap --norecursion
#
gcc:
#!/bin/sh
# This file was generated automatically by configure. Do not edit.
# This directory was configured as follows:
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-304/configure --with-gcc-version-trigger=/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-304/gcc/version.c --host=i686-pc-linux-gnu --target=mcore-elf --prefix=/tmp/crap --enable-languages=c,c++ --with-local-prefix=/tmp/crap/mcore-elf --with-newlib --norecursion
#
gdb:
#!/bin/sh
# This file was generated automatically by configure. Do not edit.
# This directory was configured as follows:
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gdb-5/configure --host=i686-pc-linux-gnu --target=mcore-elf --prefix=/tmp/crap --norecursion
#
Notice the gcc compiler is built twice, the first time as just a c
compiler, and the second as a full-up c++ compiler. You should check
Bill Gatliff's website www.billgatliff.com for more information on cross compilation.
The end result is:
[pbarada: ~/work/cvs-wavemark/cross-linux-tools/obj/crap-mcore/mcore-elf/gcc] > /tmp/crap/bin/mcore-elf-g++ -v
Reading specs from /tmp/crap/lib/gcc-lib/mcore-elf/3.0.4/specs
Configured with: /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-304/configure --target=mcore-elf --prefix=/tmp/crap --enable-languages=c,c++ --with-local-prefix=/tmp/crap/mcore-elf --with-newlib
Thread model: single
gcc version 3.0.4
Hope this helps you get where you want to go....
--
Peter Barada Peter.Barada@motorola.com
Wizard 781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola) 781-270-0193 (fax)