Toolchain is set of tools to compile software for some device/platform.
Two types of toolchains are possible:
I’ve created my toolchains using following software:
mkdir -p /opt/src mkdir -p /opt/build mkdir -p /opt/toolchain mkdir -p /opt/toolchain-native
cd /usr/bin/ ln -s ar i686-pc-linux-gnu-ar ln -s as i686-pc-linux-gnu-as ln -s cpp i686-pc-linux-gnu-cpp ln -s gcc i686-pc-linux-gnu-gcc ln -s gcov i686-pc-linux-gnu-gcov ln -s ld i686-pc-linux-gnu-ld ln -s ldd i686-pc-linux-gnu-ldd ln -s nm i686-pc-linux-gnu-nm ln -s objcopy i686-pc-linux-gnu-objcopy ln -s objdump i686-pc-linux-gnu-objdump ln -s ranlib i686-pc-linux-gnu-ranlib
cd /opt/src tar -xzf ./binutils-2.17.tar.gz mkdir -p /opt/build/bilutils-2.17 cd /opt/build/binutils-2.17/ ../../src/binutils-2.17/configure \ --prefix=/opt/toolchain \ --target=armv4lt-dns300-linux \ --with-sysroot=/opt/toolchain-native/usr/local/ make make install
cd /opt/src tar -xzf ./gcc-4.1.1.tar.gz mkdir -p /opt/build/gcc-4.1.1-cross cd /opt/build/gcc-4.1.1-cross/ PATH=/opt/toolchain/bin:$PATH \ ../../src/gcc-4.1.1/configure --prefix=/opt/toolchain \ --build=i686-pc-linux-gnu \ --host=i686-pc-linux-gnu \ --srcdir=../../src/gcc-4.1.1 \ --with-sysroot=/opt/toolchain/armv4lt-dns300-linux \ --with-as=/opt/toolchain/bin/armv4lt-dns300-linux-as \ --with-ld=/opt/toolchain/bin/armv4lt-dns300-linux-ld \ --enable-languages=c \ --target=armv4lt-dns300-linux \ --with-build-time-tools=/opt/toolchain/armv4lt-dns300-linux/bin \ --with-float=soft \ --disable-multilib
To be continued...
I’ve compiled native toolchain by my crosscompile toolchain. Maybe sometime, I’ll describe compilation procedure, but now you can just download my native toolchain and use it.
/home/sergey/toolchain/.cd /home/sergey/toolchain ; tar -xzf dns300-toolchain-1.1.tar.gzln -s /home/sergey/toolchain /opt/toolchain-nativeNote: my toolchain contains only compiler + gcc libraries from OpenRG. To compile most programs you should compile and install additional binaries like: awk, automake, findutils, etc...
export PATH=/opt/toolchain-native/usr/local/bin:$PATHroot@DNS-300:/# gcc gcc: no input files root@DNS-300:/#
So now you can use GCC to compile very simple programs, like hello-world.c. To compile complex project you should compile additional binaries. First try to compile sed to test.
/home/sergey/src/sed/./configure --prefix=/opt/toolchain-native/usr/local/
makemake install. This step is unecessary, because toolchain contains sed already, but you can test how ‘install’ works.make install