2

我正在尝试为 ARM 构建 linux 内核 3.2.81。

以下是我正在遵循的步骤:

  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. 出口 ARCH=arm
  4. 导出 CROSS_COMPILE=arm-linux-gnueabi-
  5. cd linux-3.2.81
  6. 制作 vexpress_defconfig
  7. 做所有

这是我在执行第 7 步(全部制作)时面临的错误输出:

  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

这是错误中提到的 ftrace.h (ftrace.h:51) 中的部分:

#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;
}

我正在使用 Ubuntu 操作系统,并使用 Linaro 工具链。

路径变量:

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
4

0 回答 0