目标'vmlinux'失败?

分享于 

4分钟阅读

ubuntu

  繁體

问题

我正在尝试为QEMU构建内核以模仿树莓派:http://xecdesign.com/compiling-a-kernel/https://www.raspberrypi.org/documentation/linux/kernel/building.md

它要编译很久了,但在收到此消息后停止了:


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




答案1

将下面的驱动程序添加到文件(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-



我这里工作正常。


答案2

使用Debian jessie交叉工具链也有同样的问题,使用rpi-3.18.y内核,将它跟踪到未正确定义的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.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.



然后激活config中的BCM2835并编译,我这里工作正常。



内核  TAR  目标  Recipe  
相关文章