Re: gcc-toolchain for freescale's MC9S12X (68HCS12) ??



On 2008-05-29, Florian E. Teply <onlinefloh@xxxxxxxxxxxxxxxx> wrote:

as you might guess from the subject: I'm trying to find a toolchain for
freescale's hcs12 or S12X family of microcontrollers. Currently i'm
using Codewarrior on the Windows machine at work, but as i'm a tad
dissatisfied by it's lack of decent syntax-checking and have no windows
at home, i'd rather use some free compiler available for my rather
unusual platform (Linux on PowerPC). So gcc would probably be the best
bet.

Has any of you guys experience with that combination or another
suggestion (apart from buying some windows machine)??

Building a toolchain isn't too hard. Below is the shell script
I used last time I built a toolchain for the 6812. That was
probably a couple years ago I included newlib in my build, but
IIRC, you can build a 6812 compiler without any libc at all if
you prefer.

------------------------------build-6812.sh------------------------------
#!/bin/bash

DEST=/opt/gnu/testing
TARGET=m6812-elf

BINVERS=2.15_v0501
GCCVERS=3.4.3
NLBVERS=20030821-kpit3.04
GDBVERS=6.1

HERE=$PWD
SRC=$PWD/src
BLD=$PWD/bld

set -e

echo "+++ cleaning old source directory"
rm -rf $SRC
echo "+++ cleaning old build directory"
rm -rf $BLD

export PATH=$DEST/bin:$PATH

mkdir -p $SRC

function do-binutils {
echo "+++ extracting binutils"
tar xzvf binutils-$BINVERS.tar.gz -C $SRC
echo "+++ configuring binutils"
mkdir -p $BLD/binutils
pushd $BLD/binutils
$SRC/binutils-$BINVERS/configure \
--target=$TARGET \
--prefix=$DEST \
2>&1 | tee configure.log
echo "+++ building binutils"
make 2>&1 | tee make.log
echo "+++ installing binutils"
make install 2>&1 | tee makeinstall.log
echo "+++ finshed binutils"
popd
# rm -rf $SRC/binutils-* $BLD/binutils
}

function do-gcc {
echo "=== extracting gcc"
tar xzvf gcc-$GCCVERS.tar.gz -C $SRC
if [ -d $HERE/patches/gcc ]
then
echo "=== patching gcc"
pushd $SRC/gcc-$GCCVERS
(for f in $HERE/patches/gcc/*
do
echo "==== $f"
patch -p0 <$f
done) 2>&1 | tee patch.log
popd
fi
echo "=== extracting newlib"
tar xzvf newlib-$NLBVERS.tar.gz -C $SRC
mv $SRC/newlib-$NLBVERS/newlib $SRC/gcc-$GCCVERS
mv $SRC/newlib-$NLBVERS/libgloss $SRC/gcc-$GCCVERS
echo "=== configuring gcc"
mkdir -p $BLD/gcc
pushd $BLD/gcc
$SRC/gcc-$GCCVERS/configure \
--target=$TARGET \
--prefix=$DEST \
--enable-languages=c \
--with-gnu-as \
--with-gnu-ld \
--with-newlib \
-v 2>&1 | tee configure.log
echo "=== building gcc"
make 2>&1 | tee make.log
echo "=== installing gcc"
make install 2>&1 | tee makeinstall.log
echo "=== finished gcc"
popd
# rm -rf $SRC/gcc-* $SRC/newlib-* $BLD/gcc
}

function do-gdb {
echo "=== extracting gdb"
tar xzvf gdb-$GDBVERS.tar.gz -C src
echo "=== configuring gdb"
mkdir -p $BLD/gdb
pushd $BLD/gdb
$SRC/gdb-$GDBVERS/configure \
--target=m6811-elf \
--prefix=$DEST \
-v 2>&1 | tee configure.log
echo "=== building gdb"
make 2>&1 | tee make.log
echo "=== installing gdb"
make install 2>&1 | tee makeinstall.log
echo "=== finished gdb"
popd
# rm -rf $SRC/gdb-* $BLD/gdb
}

do-binutils
do-gcc
do-gdb
-------------------------------------------------------------------------


--
Grant Edwards grante Yow! HUMAN REPLICAS are
at inserted into VATS of
visi.com NUTRITIONAL YEAST ...
.



Relevant Pages

  • Re: Compiling gcc-3.3.3 for h8300hms
    ... The "hms" platform is pretty obsolete. ... 2>&1 | tee configure.log ...
    (comp.arch.embedded)
  • RE: windows XP SP2
    ... preinstall instructions to the tee. ... > (Links to online virus scans on the same page) ... > How to optimize Windows XP, 2000, ME ...
    (microsoft.public.windowsxp.general)
  • Re: Removing programs
    ... tee wrote: ... In the old Windows, ... it was right there in the control panel. ... Programs and Features ...
    (microsoft.public.windows.vista.general)
  • Re: Wasserkocher ade
    ... Oder wo bauen die Briten selbst Tee an? ... Windows XP Home SP3 ... Opera 10.00-1285 ...
    (de.etc.haushalt)
  • Removing programs
    ... In the old Windows, ... it was right there in the control panel. ... tee's Profile: http://forums.techarena.in/members/tee.htm ...
    (microsoft.public.windows.vista.general)