Life through pinhole

My journey through life.

Wednesday, July 15, 2015

GCC Toolchain compilation for ARM

I will mainly focus on the issues that I faced while compiling the toolchain. As other relevant details are already covered by other experts.

  • Invalid machine configuration during binutils configurations
checking target system type... Invalid configuration `arm-none-linux-gnueabi-': machine `arm-none-linux-gnueabi' not recognized

Remove the extra "-" at the end from the export TARGET definition.
  • Make sure you define / export the PREFIX, TARGET variables accurately
I had a nasty output when my PREFIX was incorrectly defined as
export PREFIX=$PATH:~/project/tools/binutils-2.25/bin

Due to this bad export my "bin" directory was not populated with binaries.
  • Configure failed for GCC configurations
Added " --with-gmp --with-mpfr --with-mpc" in configure options

While configuring GMP lib, it gave another error:
checking for suitable m4... configure: error: No usable m4 in $PATH or /usr/5bin (see config.log for reasons).

Install M4 package for your Linux distro.

Best way is to install GMP, MPFR, MPC libraries using
sudo apt-get install libgmp3-de libmpfr-dev libmpc-dev
  • zlib.h error while compiling GCC
../.././gcc/lto-compress.c:28:18: fatal error: zlib.h: No such file or directory

Install zlib

  • Some strange errors while compiling GCC tool (during configure or make command)
The  target directory for installation (PREFIX) should be outside the source directory. Please refer:
"First, we highly recommend that GCC be built into a separate directory from the sources which does not reside within the source tree."

While using this toolchain for building linux for OMAP board (devkit8000) with default config I have been facing an error:
"unrecognized otpion --64"

Downloaded Linaro toolchain. During its configuration I get following error:
checking for C compiler default output file name...
configure: error: in `/home/project/tools/gcc-linaro-4.8-2014.04':
configure: error: C compiler cannot create executables
See `config.log' for more details.

Workable solution:
Prebuilt toolchain is available from: