Toolchain development
Contents |
[edit] Abstract
Some notes by Orkie following his progress creating a new toolchain for Wiz and Caanoo development.
[edit] Aim
The ultimate aim is to compile two toolchains for Windows, and provide configuration files for compiling toolchains on UNIX-like operating systems with ease. The Wiz will continue using OABI, where the Caanoo will use EABI, so separate toolchains are needed to account for this.
Because many of the components won't compile on a non-POSIX system, to build a compiler which runs on Windows, one has to do it via "Canadian-Cross", where target != host != build. These are notoriously complicated to generate, but with the help of crosstool-NG running on Debian with mingw32 installed, it should be possible to compile a toolchain which runs natively on Windows (without the need for Cygwin). I will be using crosstool-NG 1.7.0 which is the latest at the time of writing, and apparently has improved support for the Canadian-Cross (it is still not perfect by any means).
[edit] Preparing crosstool-NG
- Need to have installed: make, gcc, awk, flex, bison, automake, libtool, cvs, libncurses-dev, texinfo, lzma.
- Extract crosstool-NG.
-
./configure --prefix=/opt/ct-ng
-
make -
make install
- Add /opt/ct-ng/bin to your PATH (e.g. in ~/.bashrc).
[edit] Configuration
Any settings you need can be found in the GCC ARM docs.
-
ct-ng menuconfig
Some sample configurations:
- Canadian-cross, ARMv5 OABI
- Canadian-cross, ARMv5 EABI
- Native, ARMv5 OABI
- Native, ARMv5 EABI
[edit] Compilation
Make sure you have write-access to the directory you have told it to build to, then issue the following command:
ct-ng build
NOTE: To build a Canadian-Cross toolchain, you must first have a native toolchain targeting the Wiz installed on the build system, as well as one targeting the host (makes sense if you think about it: if you are building for Windows on Linux, you still need to build the C library, but your Linux build system can't execute the Windows binaries).
You are now done, and have a nice, working toolchain. Just need to build the libraries next!