title: Building linux kernel 3.2.81 for ARM
body: <p>I am trying to build linux kernel 3.2.81 for ARM.</p>
  
  <h2>Here are the steps I am following:</h2>
  
  <ol>
  <li>wget <a href="http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.81.tar.gz" rel="nofollow">http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.81.tar.gz</a></li>
  <li>tar xvzf linux-3.2.81.tar.gz</li>
  <li>export ARCH=arm</li>
  <li>export CROSS_COMPILE=arm-linux-gnueabi-</li>
  <li>cd linux-3.2.81</li>
  <li>make vexpress_defconfig</li>
  <li>make all</li>
  </ol>
  
  <h2>This is the error output I am facing, when I make step 7 (make all):</h2>
  
  <pre><code>  CC      init/do_mounts_initrd.o
    LD      init/mounts.o
  init/do_mounts_initrd.o: In function `return_address':
  /home/ramy/QEMU_Learn/Kernel/linux-3.2.81/arch/arm/include/asm/ftrace.h:51: multiple definition of `return_address'
  init/do_mounts.o:/home/ramy/QEMU_Learn/Kernel/linux-3.2.81/arch/arm/include/asm/ftrace.h:51: first defined here
  scripts/Makefile.build:427: recipe for target 'init/mounts.o' failed
  make[1]: *** [init/mounts.o] Error 1
  Makefile:947: recipe for target 'init' failed
  make: *** [init] Error 2
  </code></pre>
  
  <h2>This is the part in ftrace.h (ftrace.h:51) mentioned in the error:</h2>
  
  <pre><code>#if defined(CONFIG_FRAME_POINTER) &amp;&amp; !defined(CONFIG_ARM_UNWIND)
  /*
   * return_address uses walk_stackframe to do it's work.  If both
   * CONFIG_FRAME_POINTER=y and CONFIG_ARM_UNWIND=y walk_stackframe uses unwind
   * information.  For this to work in the function tracer many functions would
   * have to be marked with __notrace.  So for now just depend on
   * !CONFIG_ARM_UNWIND.
   */
  
  void *return_address(unsigned int);
  
  #else
  
  extern inline void *return_address(unsigned int level)
  {
      return NULL;
  }
  </code></pre>
  
  <p>I am working on Ubuntu operating system, and using Linaro tool chain.</p>
  
  <h2>PATH variable:</h2>
  
  <pre><code>printenv | grep PATH
  XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
  XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
  DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
  PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ramy/gcc-arm-none-eabi-5_3-2016q1/bin
  MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
  </code></pre>