2

I am trying to build linux kernel 3.2.81 for ARM.

Here are the steps I am following:

  1. wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.81.tar.gz
  2. tar xvzf linux-3.2.81.tar.gz
  3. export ARCH=arm
  4. export CROSS_COMPILE=arm-linux-gnueabi-
  5. cd linux-3.2.81
  6. make vexpress_defconfig
  7. make all

This is the error output I am facing, when I make step 7 (make all):

  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

This is the part in ftrace.h (ftrace.h:51) mentioned in the error:

#if defined(CONFIG_FRAME_POINTER) && !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;
}

I am working on Ubuntu operating system, and using Linaro tool chain.

PATH variable:

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
Ramy Sameh
  • 271
  • 4
  • 13
  • Did you make clean before make (remove directory before unpacking)? What are the settings for CONFIG_FRAME_POINTER and CONFIG_ARM_UNWIND in your `.config` file? Can you rerun failed make with `V=1` option, find the last (failed) linker command (with all arguments) and check which file contains `return_address` definitions using `nm`? (PS: which ubuntu you used? Which version of Linaro?) – osgx Jul 11 '16 at 02:12
  • 1. Yes, I made clean before make (but what do you mean by "remove directory before unpacking" ?) – Ramy Sameh Jul 12 '16 at 09:20
  • 2. I couldn't find CONFIG_FRAME_POINTER in .config CONFIG_ARM_UNWIND=y --- 3. How to make with V=1 ? --- 4. Version of Ubuntu --> Ubuntu 16.04 LTS --- Linaro --> when I typed "arm-linux-gnueabi --version", this was the output: arm-linux-gnueabi-gcc (Ubuntu/Linaro 5.3.1-14ubuntu2) 5.3.1 20160413 – Ramy Sameh Jul 12 '16 at 09:33
  • 1
    Ramy, try older Linaro with gcc 4... – osgx Jul 12 '16 at 14:17

0 Answers0