编译错误 - Raspberry Pi的内核源代码

时间:2018-05-27 06:30:54

标签: linux raspberry-pi

我正在尝试在Linux系统上为Raspberry Pi构建Linux内核版本rpi-4.14。 使用配置为bcm2709_defconfig的交叉编译器arm-linux-gnueabihf完成构建。 我正在运行命令:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs

但是我收到以下错误:

arch/arm/boot/dts/overlays/midi-uart0-overlay.dts:4:39: fatal error: dt-bindings/clock/bcm2835.h: No such file or directory
compilation terminated.
scripts/Makefile.lib:328: recipe for target 'arch/arm/boot/dts/overlays/midi-uart0.dtbo' failed
make[2]: *** [arch/arm/boot/dts/overlays/midi-uart0.dtbo] Error 1
scripts/Makefile.build:587: recipe for target 'arch/arm/boot/dts/overlays' failed
make[1]: *** [arch/arm/boot/dts/overlays] Error 2
arch/arm/Makefile:350: recipe for target 'dtbs' failed
make: *** [dtbs] Error 2

文件dt-bindings / clock / bcm2835.h已经到位,所以我真的不知道是什么问题。

2 个答案:

答案 0 :(得分:0)

错误告诉您文件丢失。

arch/arm/boot/dts/overlays/midi-uart0-overlay.dts:4:39: fatal error: dt-bindings/clock/bcm2835.h: No such file or directory

检查目录是否存在,查找所需文件并更改Makefile中的目录。

答案 1 :(得分:0)

在我的情况下,这是arch/arm/boot/dts/include下的错误符号链接。内核源代码已被7z打包/解压缩,也许是一个问题。

通过解决 ln -s ~/kernel-building/linux-raspberrypi-kernel_1.20170703-2/include/dt-bindings arch/arm/boot/dts/include/dt-bindings

尝试相对于当前目录进行链接。