GNU Toolchain‎ > ‎

Compiling mspgcc

Instructions for compiling the version-formerly-known-as-uniarch

Download the GNU masters and the patches

Place them in /opt/mspgcc like this:

./BUILD/PATCHES/msp430-binutils-2.21.1-20110716-sf3143071.patch
./BUILD/PATCHES/msp430-binutils-2.21.1-20110716-sf3379341.patch
./BUILD/PATCHES/msp430-binutils-2.21.1-20110716-sf3386145.patch
./BUILD/PATCHES/msp430-binutils-2.21.1-20110716.patch
./BUILD/PATCHES/msp430-gcc-4.5.3-20110706-sf3370978.patch
./BUILD/PATCHES/msp430-gcc-4.5.3-20110706-sf3390964.patch
./BUILD/PATCHES/msp430-gcc-4.5.3-20110706.patch
./BUILD/PATCHES/msp430-gdb-7.2-20110103.patch
./BUILD/PATCHES/msp430-libc-20110612-sf3387164.patch
./BUILD/PATCHES/msp430mcu-20110613-sf3379189.patch
./BUILD/PATCHES/msp430mcu-20110613-sf3384550.patch
./BUILD/PATCHES/README.rst
./BUILD/TARBALLS/binutils-2.21.1.tar.bz2
./BUILD/TARBALLS/gcc-4.5.3.tar.bz2
./BUILD/TARBALLS/gdb-7.2.tar.bz2
./BUILD/TARBALLS/msp430mcu-20110613.tar.bz2
./BUILD/TARBALLS/mspgcc-20110716.tar.bz2

Commands to build in /opt/mspgcc:

/opt/mspgcc/BUILD> bzip2 -cd TARBALLS/binutils-2.21.1.tar.bz2 | tar xvf -
/opt/mspgcc/BUILD> cd binutils-2.21.1
/opt/mspgcc/BUILD/binutils-2.21.1> patch -p1 < ../PATCHES/msp430-binutils-2.21.1-20110716.patch
/opt/mspgcc/BUILD/binutils-2.21.1> patch -p1 < ../PATCHES/msp430-binutils-2.21.1-20110716-sf3143071.patch 
/opt/mspgcc/BUILD/binutils-2.21.1> patch -p1 < ../PATCHES/msp430-binutils-2.21.1-20110716-sf3379341.patch 
/opt/mspgcc/BUILD/binutils-2.21.1> patch -p1 < ../PATCHES/msp430-binutils-2.21.1-20110716-sf3386145.patch
/opt/mspgcc/BUILD/binutils-2.21.1> cd ..
/opt/mspgcc/BUILD> mkdir binutils
/opt/mspgcc/BUILD> cd binutils
/opt/mspgcc/BUILD/binutils> ../binutils-2.21.1/configure --target=msp430 --prefix=/opt/mspgcc
/opt/mspgcc/BUILD/binutils> make
/opt/mspgcc/BUILD/binutils> make install
/opt/mspgcc/BUILD/binutils-2.21.1> cd ..

/opt/mspgcc/BUILD> bzip2 -cd TARBALLS/gcc-4.5.3.tar.bz2 | tar xvf -
/opt/mspgcc/BUILD> cd gcc-4.5.3/
/opt/mspgcc/BUILD/gcc-4.5.3> patch -p1 < ../PATCHES/msp430-gcc-4.5.3-20110706.patch
/opt/mspgcc/BUILD/gcc-4.5.3> patch -p1 < ../PATCHES/msp430-gcc-4.5.3-20110706-sf3370978.patch
/opt/mspgcc/BUILD/gcc-4.5.3> patch -p1 < ../PATCHES/msp430-gcc-4.5.3-20110706-sf3390964.patch 
/opt/mspgcc/BUILD/gcc-4.5.3> cd ..
/opt/mspgcc/BUILD> mkdir gcc
/opt/mspgcc/BUILD> cd gcc
/opt/mspgcc/BUILD/gcc> ../gcc-4.5.3/configure --target=msp430 --enable-languages=c,c++ --prefix=/opt/mspgcc CFLAGS=-I/opt/macports/include LDFLAGS=-L/opt/macports/lib
/opt/mspgcc/BUILD/gcc> make
/opt/mspgcc/BUILD/gcc> make install
/opt/mspgcc/BUILD/gcc> cd ..

/opt/mspgcc/BUILD> bzip2 -cd TARBALLS/msp430mcu-20110613.tar.bz2 | tar xvf -
/opt/mspgcc/BUILD> cd msp430mcu-20110613/
/opt/mspgcc/BUILD/msp430mcu-20110613> patch -p1 < ../PATCHES/msp430mcu-20110613-sf3379189.patch 
/opt/mspgcc/BUILD/msp430mcu-20110613> patch -p1 < ../PATCHES/msp430mcu-20110613-sf3384550.patch
/opt/mspgcc/BUILD/msp430mcu-20110613> export MSP430MCU_ROOT=$(pwd)
/opt/mspgcc/BUILD/msp430mcu-20110613> sh scripts/install.sh /opt/mspgcc
/opt/mspgcc/BUILD/msp430mcu-20110613> cd ..

/opt/mspgcc/BUILD> bzip2 -cd TARBALLS/msp430-libc-20110612.tar.bz2 | tar xvf -
/opt/mspgcc/BUILD> cd msp430-libc-20110612/src
/opt/mspgcc/BUILD/msp430-libc-20110612/src> make PREFIX=/opt/mspgcc
/opt/mspgcc/BUILD/msp430-libc-20110612/src> make PREFIX=/opt/mspgcc install
/opt/mspgcc/BUILD/msp430-libc-20110612/src> cd ../..

/opt/mspgcc/BUILD> bzip2 -cd TARBALLS/gdb-7.2.tar.bz2 | tar xvf -
/opt/mspgcc/BUILD> cd gdb-7.2
/opt/mspgcc/BUILD/gdb-7.2> patch -p1 < ../PATCHES/msp430-gdb-7.2-20110103.patch 
/opt/mspgcc/BUILD/gdb-7.2> cd ..
/opt/mspgcc/BUILD> mkdir gdb
/opt/mspgcc/BUILD> cd gdb
/opt/mspgcc/BUILD/gdb> ../gdb-7.2/configure --target=msp430 --prefix=/opt/mspgcc
/opt/mspgcc/BUILD/gdb> make
/opt/mspgcc/BUILD/gdb> make install
/opt/mspgcc/BUILD/gdb> cd ..

/opt/mspgcc/BUILD> git clone git://mspdebug.git.sourceforge.net/gitroot/mspdebug/mspdebug
/opt/mspgcc/BUILD> cd mspdebug
/opt/mspgcc/BUILD/mspdebug> make PREFIX=/opt/mspgcc CFLAGS=-I/opt/macports/include LDFLAGS=-L/opt/macports/lib
/opt/mspgcc/BUILD/mspdebug> make PREFIX=/opt/mspgcc install


And hopefully that should do it!

Comments