diff --git a/Cross-Compiler.md b/Cross-Compiler.md new file mode 100644 index 0000000..673cef0 --- /dev/null +++ b/Cross-Compiler.md @@ -0,0 +1,40 @@ +This page explains how to build the cross compiler for building and running Thor. + +## Download + +Download binutils and GCC + + mkdir $HOME/src/ + cd $HOME/src/ + wget ftp://ftp.gnu.org/gnu/binutils/binutils-2.9.tar.gz + wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.gz + tar xvzf binutils* + tar xvzf gcc* + +## Configuration + + export PREFIX="$HOME/opt/cross" + export TARGET=x86_64-elf + export PATH="$PREFIX/bin:$PATH" + +## Build binutils + + cd $HOME/src + mkdir build-binutils + cd build-binutils + ../binutils-*/configure --target=$TARGET --prefix="$PREFIX" --disable-nls + make + make install + +## Build GCC + + cd $HOME/src + mkdir build-gcc + cd build-gcc + ../gcc-*/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ + make all-gcc + make all-target-libgcc + make install-gcc + make install-target-libgcc + +Normally, you should now have a working x86_64-elf cross compiler. \ No newline at end of file