Raining Season

Learning About ARM : Making ARM-Cross Compiler on Linux


Chapter : 1
Making ARM-Cross Compiler on Linux

Date : Sun, 23 August 2009
Writer : Ataya P
ARM NXP board
Working Platform
:

Lenovo Notebook , Intel Pentium Dual Core T2080 1.73GHz
2Gbyte RAM
Ubuntu 9.04 -Jaunty Jackalope

Cooking ingredient :
  1.binutils-2.19
  2.binutils-patch
  3.gcc-4.4.1
  4.newlib-1.17.0
  5.gdb-6.8


Let's do it :
   1.extract all sources
   2. cd [binutils-build]
   3. patch binutils source
   4. [binutils-source]/configure --target=arm-elf --prefix=[toolchain-prefix] --enable-interwork --enable-multilib --with-float=soft
   5. make all install
   6. export PATH="$PATH:[toolchain-prefix]/bin"
   7. cd [gcc-build]
   8. [gcc-source]/configure --target=arm-elf --prefix=[toolchain-prefix] --enable-interwork --enable-multilib --with-float=soft --enable-languages="c,c++" --with-newlib --with-headers=[newlib-source]/newlib/libc/include
   9. make all-gcc install-gcc
  10. cd [newlib-build]
  11. [newlib-source]/configure --target=arm-elf --prefix=[toolchain-prefix] --enable-interwork --enable-multilib --with-float=soft
  12. make all install
  13. cd [gcc-build]
  14. make all install
  15. cd [gdb-build]
  16. [gdb-source]/configure --target=arm-elf --prefix=[toolchain-prefix] --enable-interwork --enable-multilib --with-float=soft --disable-werror
  17. make all install

Now try to compile some source code by making hello_world.c

#include<stdio.h>
int main()
{
 puts("hello world!");
 return 0;
}

Then, use below command to compile and linking the code
  1. arm-elf-gcc -mcpu=arm7tdmi -mthumb -O2 -g -c hello_world.c
  2. arm-elf-gcc -mcpu=arm7tdmi -mthumb -o hello_world hello_world.o -lc
then hello_world file should be make without problem.


Files and Sourcecode :
binutil patch



GO GO GO ARM !!!




Share this page :

Custom Search