================================================================================= How to Build GNU Tool Suite for NaviEngine Copyright (C) 2009 T-Engine Forum. All Rights Reserved. ------------------------------------------------------------------------- Version: 1.00.00 Released by T-Engine Forum (http://www.t-engine.org) on 2009/02/25. ================================================================================= 1. Preface 2. Caveats 3. How to build ----------------------------------------------------------------------------------------------------------------------- 1. Preface ----------------------------------------------------------------------------------------------------------------------- This note explains how to build the GNU tool used to compile T-Kernel for NaviEngine from the source code. -------------------------------------------------------------------------------------------------------- Note: The following explains how to build the GNU tool from the source code. When you use an already built archive released on the website, the following steps are not required. -------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------- 2. Caveats ----------------------------------------------------------------------------------------------------------------------- It is assumed that this GNU tool will be used only to create executable T-Kernels for NaviEngine and will not be used for any other purposes. The T-Engine Forum does not support this tool. ----------------------------------------------------------------------------------------------------------------------- 3. How to Build the GNU Tool Suite ----------------------------------------------------------------------------------------------------------------------- This section explains how to build the GNU tool from the source code. Used shell and build and installation directories can be chosen arbitrarily. This note explains the following configurations. ・Shell: bash ・Build Directory: /home/tkernel/tool/arm11mpcore ・Installation Directory: /usr/local/te/arm11mpcore 3.1 Installation of Cygwin(TM) This GNU tool runs on the Cygwin(TM), the UNIX Emulator for Windows(R). Refer to Cygwin website (http://www.cygwin.com/) for instructions on how to install Cygwin. The packages below, in addition to the ones selected by default, are necessary for installation. ・Devel category: "gcc", "make" ・Interpreters category: "perl" ・Libs category: "libgmp-devel", "libmpfr-devel" ・Utils category: "file", "patch" After installation, start Cygwin and create symbolic links. $ ln -s make /usr/bin/gmake $ ln -s /usr/bin/perl /usr/local/bin/perl 3.2 Downloading the GNU Tool Suite To compile the GNU tool, binutils, gcc, and the newlib packages are required. As of February 2009, these packages are available from the following sites. ・http://ftp.gnu.org/gnu/binutils/ ・http://gcc.gnu.org/ ・http://www.sourceware.org/newlib/ Download the following files to /home/tkernel/tool/arm11mpcore. ・binutils-2.19.tar.gz ・gcc-core-4.3.2.tar.gz ・newlib-1.17.0.tar.gz Place the patch for NaviEngine in /home/tkernel/tool/arm11mpcore. Expand the downloaded tar archives. Start Cygwin and enter the following commands. All the subsequent tasks are performed in Cygwin environment. $ cd /home/tkernel/tool/arm11mpcore $ tar zxf binutils-2.19.tar.gz $ tar zxf gcc-core-4.3.2.tar.gz $ tar zxf newlib-1.17.0.tar.gz Apply the patch to gcc. $ patch -d gcc-4.3.2 -Np1 < gcc-4.3.2-arm11mpcore-patch 3.3 Setting Environment Variables To set the environment variables, enter the following commands. $ export GNUs=/usr $ export GNU_BD=/usr/local/te/arm11mpcore $ export GNUarm=$GNU_BD/arm-elf $ export GCC_EXEC_PREFIX=$GNU_BD/lib/gcc/ $ export PATH=$GNU_BD/bin:$PATH When Cygwin is restarted, the environment variables must be reset. You can write the above command sequence in ".bashrc" file to omit retyping the commands when cygwin is restarted. 3.4 binutils Create a directory for building binutils. $ cd /home/tkernel/tool/arm11mpcore $ mkdir build_binutils Configure binutils. $ cd build_binutils $ ../binutils-2.19/configure --target=arm-elf --prefix=$GNU_BD Build and install binutils. $ make $ make install 3.5 gcc Create a directory for building gcc. $ cd /home/tkernel/tool/arm11mpcore $ mkdir build_gcc Configure gcc. $ cd build_gcc $ ../gcc-4.3.2/configure --target=arm-elf --prefix=$GNU_BD --with-gnu-as --with-gnu-ld --enable-languages=c --disable-libssp --with-newlib --enable-interwork --enable-multilib --with-headers=/home/tkernel/tool/arm11mpcore/newlib-1.17.0/newlib/libc/include --with-arch=armv6k --with-float=soft Build and install gcc. $ make $ make install This finishes the building and installation.