MSPGCC

I needed to get mspgcc running so that I could compile the firmware for a device I've been messing around with called the GoodFET30. Unfortunately, MSPGCC is a nasty piece of work, and it was a PITA to get running. I finally got it working and this page describes the method I used. NOTE: You MUST have gcc-3.4.6 installed for this to work!!

Ingredients

  1. mspgcc (from cvs)
  2. binutils-2.18
  3. gcc-core-3.2.3.tar.bz2

Make a directory structure:
staging
\-mspgcc
\-binutils
\-gcc
\-msp430-libc

Get mspgcc

checkout mspgcc into staging/mspgcc:

for module in gcc gdb gdbproxy jtag msp430-libc packaging; do cvs -z3 -d:pserver:anonymous@mspgcc.cvs.sourceforge.net:/cvsroot/mspgcc co -P ${module};done

Once that's done, move onto binutils

binutils

Unpack binutils into the staging/binutils directory and then, from the binutil patches in the mspgcc/packaging/patches directory, patch binutils in the following order (using patch -p1 < $patchfile):

  1. binutils-2.18-14x1-20x1-20x2-20x3-22x4-42x-42x0-461x.patch
  2. binutils-2.18-msp430x24x-msp430x26x.patch
  3. binutils-ld_scripts.patch
  4. binutils-2.18-430X.patch
At this point, binutils still won't compile properly, but it should be easy enough to fix.

Configuring binutils

mkdir staging/binutils/build
inside the build directory, run: ../binutils-2.18/configure --target=msp430 --prefix=/usr/local
This will configure binutils, then type: CC=gcc-3.4.6 make -j2
You will still need to make sure that you edit the configure.ac file and make sure that your makeinfo script is a high enough version (or modify the test) then re-run autoconf before you run configure. MAKE WILL FAIL! the fixes are easy though, I need to make a patch of what I changed. Until then, just fix then remake, it should only take about 5 fixes I think
*EDIT* get the patch Then sudo make install

GCC

Unpack gcc-core-3.2.3.tar.bz2 into your gcc directory, then
cp -a staging/mspgcc/gcc/gcc-3.3/* gcc-3.2.3/
Now set up your path: export PATH="/usr/local/msp430/bin:$PATH"
Do the same thing as binutils, make a build directory and run: ../gcc-3.2.3/configure --target=msp430 --prefix=/usr/local --enable-languages=c
CC=gcc-3.4.6 make -j2
sudo make install

msp430-libc

This is where I had the most problems, basically, binutils of the wrong version won't have the correct chips enabled and so the assembly will fail misserably. But, if all goes well, you should simply be able to modify the makefile and change the prefix to /usr/local, then go ahead and do a make and make install and it should work!