编译 linux 内核相关的问题


在 Arch Linux 上,编译 Linux 内核需要依赖两个默认没有提供的工具:

bc: An aribitrary precision calculator language (https://www.gnu.org/software/bc/)
cpio: A tool to copy files into or out of a cpio or tar archive (https://www.gnu.org/software/cpio)
pahole: Pahole and other DWARF utils

缺少 cpio 的报错比较迷惑:

make[1]: *** [kernel/Makefile:146: kernel/kheaders_data.tar.xz] Error 127

缺少 pahole 的报错:

BTF: .tmp_vmlinux.btf: pahole(pahole) is not available