How to use a create a cross compiler for Linux Download and unpack binutils - http://gnuftp.uib.no/binutils gcc - http://gnuftp.uib.no/gcc/ gmp (dependency for gcc) - http://gnuftp.uib.no/gmp/ mpfr (dependency for gcc) - http://gnuftp.uib.no/mpfr/ mpc (dependency for gcc) - http://gnuftp.uib.no/mpc/ isl (OPTIONAL dependency for gcc) http://isl.gforge.inria.fr/ cd gcc-* ln -s ../gmp-* gmp ln -s ../mpfr-* mpfr ln -s ../mpc-* mpc ln -s ../isl-* isl export TARGET=arm-linux-gnueabihf && export KERNEL_ARCH=arm or export TARGET=s390x-unknown-linux && export KERNEL_ARCH=s390 mkdir /tmp/binutils-obj cd /tmp/binutils-obj #without glibc ${HOME}/binutils-*/configure --prefix=/opt/cross --target=${TARGET} #with glibc ${HOME}/binutils-*/configure --prefix=/opt/cross --target=${TARGET} --with-sysroot=/opt/cross/sysroot.${TARGET} make -j$(nproc) make install-strip -j4 #without glibc - and only support for C mkdir /tmp/gcc-obj cd /tmp/gcc-obj ${HOME}/gcc-*/configure --prefix=/opt/cross --libexecdir=/opt/cross/lib --target=${TARGET} --enable-languages=c make all-gcc -j$(nproc) make install-strip-gcc -j4 # now you can compile the linux kernel make ARCH=${KERNEL_ARCH} O=/tmp/kernel.build defconfig make ARCH=${KERNEL_ARCH} O=/tmp/kernel.build CROSS_COMPILE=${TARGET}- -j$(nproc) #with glibc # Here we have a chicken/egg problem. glibc needs libgcc in order to compile, and libgcc needs glibc. But there is a hack. mkdir /tmp/gcc-stage1 cd /tmp/gcc-stage1 ${HOME}/gcc-*/configure --prefix=/opt/cross --libexecdir=/opt/cross/lib --target=${TARGET} --enable-languages=c --disable-threads --disable-shared make all-gcc all-target-libgcc -j$(nproc) make install-strip-gcc install-strip-target-libgcc -j4 cd ~/linux*/ make ARCH=${KERNEL_ARCH} O=/tmp/kernel.build INSTALL_HDR_PATH=/opt/cross/sysroot.${TARGET}/usr headers_install #glibc mkdir /tmp/glibc-stage1 cd /tmp/glibc-stage1 ~/glibc/configure --prefix=/usr --host=${TARGET} --with-headers=/opt/cross/sysroot.${TARGET}/usr/include make -j$(nproc) make install DESTDIR=/opt/cross/sysroot.${TARGET} mkdir /tmp/gcc-stage2 cd /tmp/gcc-stage2 ${HOME}/gcc-*/configure --prefix=/opt/cross --libexecdir=/opt/cross/lib --target=${TARGET} --enable-languages=c,c++ --with-sysroot=/opt/cross/sysroot.${TARGET} make -j$(nproc) make install-strip -j4 #try with glibc now mkdir /tmp/glibc-stage2 cd /tmp/glibc-stage2 ~/glibc/configure --prefix=/usr --host=${TARGET} make -j$(nproc) make install DESTDIR=/opt/cross/sysroot.${TARGET} Now you can move $(pwd)/dest/${TARGET} where ever you want. If you are sparse on disk space you can trim it a bit as well $ rm -rf dest/*/{include,share} dest/*/lib/libcc* $ find dest -name '*.la' -delete $ find dest -name "*.a" -exec ./dest/*/bin/*-strip -g "{}" \; Notes BSD and MacOS. This will most probably work if you use gmake instead of make. Git If you get your sources with git, you'll also need flex, bison and makeinfo (texinfo). GMP, MPFR, MPC and ISL You can skip this if you already have them installed. They are not target libraries. Keep in mind that you need both the libraries and the headers installed in order to use them. In some distributions that means that you also need to have the -dev or -devel packages installed.