在Ubuntu 18.04.2 LTS 系统中编译linux-4.0内核代码。报错:
Unsupported relocation type: R_X86_64_PLT32 (4)
arch/x86/boot/compressed/Makefile:70: recipe for target 'arch/x86/boot/compressed/vmlinux.relocs' failed
make[2]: *** [arch/x86/boot/compressed/vmlinux.relocs] Error 1
arch/x86/boot/Makefile:111: recipe for target 'arch/x86/boot/compressed/vmlinux' failed
make[1]: *** [arch/x86/boot/compressed/vmlinux] Error 2
arch/x86/Makefile:231: recipe for target 'bzImage' failed
make: *** [bzImage] Error 2
解决方案可参考如下链接:
x86: Treat R_X86_64_PLT32 as R_X86_64_PC32
将对应文件加上对应的代码,重新编译即可。
,如果出现如下错误:
/bin/sh: 1: lz4c: not found
arch/x86/boot/compressed/Makefile:86: recipe for target 'arch/x86/boot/compressed/vmlinux.bin.lz4' failed
make[2]: *** [arch/x86/boot/compressed/vmlinux.bin.lz4] Error 1
arch/x86/boot/Makefile:111: recipe for target 'arch/x86/boot/compressed/vmlinux' failed
make[1]: *** [arch/x86/boot/compressed/vmlinux] Error 2
arch/x86/Makefile:231: recipe for target 'bzImage' failed
sudo apt-get install liblz4-tool
如果遇到其他错误可参考如下链接: