Didj Build Environment

Buildcross is able to build a working toolchain that supports C and C++.

Prebuilt
Since it can be a pain to build the cross compiler on Windows, I'm providing a prebuilt toolchain. 32 bit Ubuntu 9.10 does some incorrect things during GCC's build that causes the built to fail. So I've provide that one too.

Windows


 * Windows
 * (broken) Fast Windows mirror
 * (broken) Fast Windows mirror

Extract to C:\ (full path to bin is C:\winarm\didj\bin) It should work in the root of any partition.

Ubuntu 9.10 (Karmic, but also known to work fine on 10.4-Lucid)
 * 32 bit Ubuntu 9.10
 * (broken) Fast 32 bit Ubuntu 9.10 mirror
 * (broken) Fast 32 bit Ubuntu 9.10 mirror

Extract to /usr/local

 Debian Lenny 


 * 64 bit Debian Lenny
 * (broken) Fast 64 bit Debian Lenny mirror

Extract to /usr/local

Additional mirrors would be welcomed.

Prerequisites

 * git (In deb based distros, it's in the git-core package)
 * gmp (In deb based distros it's often called libgmp-dev or libgmp3-dev)
 * mpfr (In deb based distros it's often called libmpfr-dev)
 * GCC & Binutils
 * Flex
 * Bison
 * Make
 * Makeinfo (In deb based distros it's in the texinfo package)
 * patch
 * diff
 * wget
 * And a Unix environment (Only really tested on Linux)

Steps

 * git clone git://github.com/losinggeneration/buildcross.git
 * cd buildcross
 * sudo mkdir /usr/local/didj
 * sudo chown [your username]:[any group] /usr/local/didj
 * MAKE="make -j3" ./buildcross.sh didj -bl
 * Replace -j3 with however many processors/cores you have +1

After that, the cross compiler should be built. You should now be able to build binaries for the Didj. I'd suggest adding /usr/local/didj/bin to your PATH. This is often in $HOME/.profile. Depending on your shell, Bash compatible shells can use: export PATH=/usr/local/didj/bin:$PATH

Usage
The following all assumes the PATH has been correctly setup.

Simple usage
Typical usage for compiling and linking a single file: arm-linux-uclibcgnueabi-gcc -o hello hello.c

Autotools
Typical usage for cross compiling a project that uses autotools ./configure --host=arm-linux-uclibcgnueabi make

CMake cross compiler rules
Save this file as ~/didj/didj.cmake SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_VERSION 1) SET(CMAKE_C_COMPILER  /usr/local/didj/bin/arm-linux-uclibcgnueabi-gcc) SET(CMAKE_CXX_COMPILER /usr/local/didj/bin/arm-linux-uclibcgnueabi-g++) SET(CMAKE_FIND_ROOT_PATH /usr/local/didj /home/harley/didj/rootfs /home/harley/didj/custom/rootfs) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 * 1) this one is important
 * 1) this one not so much
 * 1) specify the cross compiler
 * 1) where is the target environment
 * 1) search for programs in the build host directories
 * 1) for libraries and headers in the target directories

Then use this command to build it. It's better to build in a clean subdirectory in CMake projects. mkdir build && cd build cmake -DCMAKE_TOOLCHAIN_FILE=~/didj/didj .. make

Linux Kernel
make ARCH=arm CROSS_COMPILE=arm-linux-uclibcgnueabi-

Scons
To be written.

Others
Any others you run into please document here.