Difference between revisions of "UWAR:MSP"

From PublicWiki
Jump to: navigation, search
(Building a Toolchain)
(Building an MSP Toolchain)
 
Line 56: Line 56:
  
 
Let 'em rip.
 
Let 'em rip.
 +
 +
== Building a Stargate2 Toolchain ==
 +
 +
The toolchain for the Stargate2 is different and a little less complicated because of the FPU on the SG2.  No patches are needed.
 +
 +
    #!/bin/sh
 +
    set -ex
 +
   
 +
    export TARBALLS_DIR=`pwd`/downloads
 +
    export RESULT_TOP=/Users/bdferris/usr/arm-linux
 +
   
 +
    export GCC_LANGUAGES="c,c++"
 +
   
 +
    export KERNELCONFIG=`pwd`/arm.config
 +
    export TARGET=arm-linux
 +
    export TARGET_CFLAGS="-O"
 +
    export GCC_EXTRA_CONFIG="--with-cpu=xscale  --enable-cxx-flags=-mcpu=xscale"
 +
   
 +
    export BINUTILS_DIR=binutils-2.15
 +
    export GCC_DIR=gcc-3.4.3
 +
    export GLIBC_DIR=glibc-2.3.3
 +
    export LINUX_DIR=linux-2.6.14
 +
    export LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
 +
    export GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.3
 +
   
 +
    sh all.sh --notest
 +
   
 +
    echo Done.
 +
 +
There are some issues compiling glibc-2.3.3 on Mac OS X, so check out http://osdir.com/ml/gcc.cross-compiling/2004-12/msg00075.html for some hints.

Latest revision as of 05:27, 21 August 2007


Existing Toolchain

An existing toolchain for the MSP can be found at

   /projects/ubicomp/uwar/arm-linux

Building an MSP Toolchain

Interested in building a toolchain for the MSP's ARM XScale processor? Here's how I made it work...

You need to download Crosstool, a set for script and patches for building crosscompile toolchains.

We'll be specifically targeting the following package profile:

gcc-3.4.3 glibc-2.3.2

Since we're targeting an ARM processor, we need to apply a few patches for the ARM architecture with VFP floating point support, as made available here.

Specifically, you need the following patches:

   patches/gcc-3.4.3/gcc-3.4.3-arm-softvfp.patch
   patches/glibc-2.3.2/glibc-2.3.2-initfini.patch
   patches/glibc-2.3.2/glibc-2.3.2-output_format.patch
   patches/glibc-2.3.2/glibc-2.3.2-sysctl.patch
   patches/glibc-linuxthreads-2.3.2/glibc-linuxthreads-2.3.2-initfini.patch

Once you've downloaded, unpacked, and copied the patches into their appropriate locations in the crosstool tree, you're read to start building. My build script looked like the following:

  #!/bin/sh
  set -ex
  
  export TARBALLS_DIR=`pwd`/downloads
  export RESULT_TOP=/usr/local/arm-linux
  
  export GCC_LANGUAGES="c,c++"
  
  export KERNELCONFIG=`pwd`/arm.config
  export TARGET=arm-linux
  export TARGET_CFLAGS="-O"
  export GCC_EXTRA_CONFIG="--with-cpu=iwmmxt  --enable-cxx-flags=-mcpu=iwmmxt --with-fpu=vfp"
  export GLIBC_EXTRA_CONFIG="--without-fp"
  
  export BINUTILS_DIR=binutils-2.15
  export GCC_DIR=gcc-3.4.3
  export GLIBC_DIR=glibc-2.3.2
  export LINUX_DIR=linux-2.6.14
  export LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
  export GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2
  
  sh all.sh --notest
  
  echo Done.

Let 'em rip.

Building a Stargate2 Toolchain

The toolchain for the Stargate2 is different and a little less complicated because of the FPU on the SG2. No patches are needed.

   #!/bin/sh
   set -ex
   
   export TARBALLS_DIR=`pwd`/downloads
   export RESULT_TOP=/Users/bdferris/usr/arm-linux
   
   export GCC_LANGUAGES="c,c++"
   
   export KERNELCONFIG=`pwd`/arm.config
   export TARGET=arm-linux
   export TARGET_CFLAGS="-O"
   export GCC_EXTRA_CONFIG="--with-cpu=xscale  --enable-cxx-flags=-mcpu=xscale"
   
   export BINUTILS_DIR=binutils-2.15
   export GCC_DIR=gcc-3.4.3
   export GLIBC_DIR=glibc-2.3.3
   export LINUX_DIR=linux-2.6.14
   export LINUX_SANITIZED_HEADER_DIR=linux-libc-headers-2.6.12.0
   export GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.3
   
   sh all.sh --notest
   
   echo Done.

There are some issues compiling glibc-2.3.3 on Mac OS X, so check out http://osdir.com/ml/gcc.cross-compiling/2004-12/msg00075.html for some hints.