目标’vmlinux’的配方失败了吗?

我正在尝试为QEMU构建一个内核来模拟一个覆盆子: http : //xecdesign.com/compiling-a-kernel/ https://www.raspberrypi.org/documentation/linux/kernel/building.md

但是,运行命令:make ARCH = arm

它很好地编译了很长时间,但是当它得到这个消息时就停止了:

kevin@kevin-laptop:~/linux$ make ARCH=arm CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h make[1]: 'include/generated/mach-types.h' is up to date. CALL scripts/checksyscalls.sh CHK include/generated/compile.h CHK kernel/config_data.h LINK vmlinux LD vmlinux.o MODPOST vmlinux.o GEN .version CHK include/generated/compile.h UPD include/generated/compile.h CC init/version.o LD init/built-in.o drivers/built-in.o: In function `mmc_fixup_device': of_iommu.c:(.text+0xb9674): undefined reference to `mmc_debug' Makefile:923: recipe for target 'vmlinux' failed make: *** [vmlinux] Error 1 

我不确定它告诉我的是什么。 我的猜测是它无法在编译中找到它需要的库。 我正在使用raspberry pi工具包(看起来它应该是即插即用,如果他们在官方的Pi工具链的git上有它)

有帮助吗?

将以下驱动程序添加到文件中(arch / arm / configs / bcm2835_defconfig)

  CONFIG_MMC_BCM2835=y CONFIG_MMC_BCM2835_DMA=y CONFIG_DMADEVICES=y CONFIG_DMA_BCM2708=y cp arch/arm/configs/bcm2835_defconfig ./.config make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- menuconfig make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- 

这个对我有用。

而已。

使用Debian jessie交叉工具链有同样的问题。 使用rpi-3.18.y内核。 将其mmc_debug未正确定义的mmc_debug

 christoph@debian:~/raspidev/linux$ find drivers/mmc -name \*.c -exec -H grep mmc_debug {} \; drivers/mmc/host/bcm2835-mmc.c drivers/mmc/host/omap_hsmmc.c drivers/mmc/core/quirks.c 

bcm2835-mmc.c ,只有bcm2835-mmc.cquirks.c定义了符号:

 bcm2835-mmc.c: /*static */unsigned mmc_debug; /*static */unsigned mmc_debug2; module_param(mmc_debug, uint, 0644); module_param(mmc_debug2, uint, 0644); quirks.c: extern unsigned mmc_debug; 

所以我回去并在我的配置中启用了MMC驱动程序以及BCM2835主机适配器。 这已添加到已应用的配置补丁。

 diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 3e7abcd..95eb332 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -6,7 +6,7 @@ comment "MMC/SD/SDIO Host Controller Drivers" config MMC_BCM2835 tristate "MMC support on BCM2835" - depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835 + depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835 || ARCH_VERSATILE_PB || ARCH_VERSATILE_AB help This selects the MMC Interface on BCM2835. 

然后在配置中激活BCM2835并进行编译。 为我工作。