lxdream.org :: Cross Compiler Information
lxdream 0.9.1
released Jun 29
Download Now
Personal tools
  • Page
  • Discussion
  • View source
  • History
  • Cross Compiler Information

    Jump to: navigation, search

    Setting up the cross-compilers for Dreamcast development:

    SH4 Cross-GCC

    Firstly, get binutils-2.16.tar.bz2 and gcc-3.4.1.tar.bz2 from ftp.gnu.org or one of the mirrors. Yes, those versions exactly. Later point releases of gcc 3.4 may also work, but haven't been tested. Later versions of binutils do NOT work.

    Build and install binutils into /usr/local:

    ~$ tar -xjvf binutils-2.16.tar.bz2
    ~$ mkdir build-binutils-sh
    ~$ cd build-binutils-sh
    ~$ ../binutils-2.16/configure --target=sh-elf --prefix=/usr/local
    ~$ make install

    Build and install gcc into /usr/local

    ~$ tar -xjvf gcc-3.4.1.tar.bz2
    ~$ mkdir build-gcc-sh
    ~$ cd build-gcc-sh
    ~$ ../gcc-3.4.1/configure --target=sh-elf --enable-languages=c,c++ --prefix=/usr/local
    ~$ make install

    Build and install newlib - this was painful, anyone want to write up how to do it properly? There's some binaries in the lxdream distribution that you can use instead. Or you can use KOS instead, of course.

    Caveats: binutils 2.16 doesn't build cleanly on OSX due to configuration problems - it requires much fiddling to get working.

    ARM Cross-GCC

    Building the ARM cross-compiler is identical to the above, but use --target=arm-elf instead of --target=sh-elf