##Set environment variables
export TARGET=aarch64-none-elf
export PREFIX=/work/public/$TARGET
export PATH=$PATH:$PREFIX/bin
##Build binutils
mkdir build-binutils
cd build-binutils
../binutils-source/configure --target=$TARGET --prefix=$PREFIX
make all
make install
##Prerequisite libs
cd gcc-source
bash ./contrib/download_prerequisites
cd ..
prerequisite libs (GMP/MPFR/MPC), put them into gcc director, and link statically.
If not, the system gmp/mpft/mpc libraries will be used, and linked dynamically.
http://advogato.org/person/redi/diary/253.html
##Build gcc
mkdir build-gcc
cd build-gcc
../gcc-source/configure --target=$TARGET --prefix=$PREFIX --without-header --with-newlib --with-gnu-as --with-gnu-ld --enable-lto --enable-linker-build-id --disable-libmudflap --disable-libgomp --disable-libssp --disable-libstdcxx-pch --enable-multiarch --disable-multilib --enable-languages=c,c++ --with-headers=../newlib-source/newlib/libc/include --disable-shared
make
make install
##Build newlib
mkdir build-newlib
cd build-newlib
../newlib-source/configure --target=$TARGET --prefix=$PREFIX
make -j8
make install
##Build GCC again with newlib
cd build-gcc
make -j8
make install
##Build GDB
mkdir build-gdb
cd build-gdb
../gdb-source/configure --target=$TARGET --prefix=$PREFIX --enable-interwork
##Errors ###checking for the value of EOF... configure: error: computing EOF failed --with-headers=../newlib-source/newlib/libc/include ###error while loading shared libraries: libmpc.so.2 Please refer [step 3](#Prerequisite libs)
is it the same issue? jcmvbkbc/crosstool-NG#68