如果提示lld.ld not found, 需要先安装lld,后续版本中lld已经没有包含在llvm里面了,需要单独安装。
设置编译选项
1
lkmake ARCH=arm64 menuconfig
编译内核
1
lkmake ARCH=arm64 LLVM=1 -j $(nproc)
编译完成后会生成vmlinux文件。
用file命令查看文件类型:
1
file vmlinux
输出类似:
1
vmlinux: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), statically linked, BuildID[sha1]=aedcccc5579d4c80a4c0934e6fd1a18c0a682fa2, with debug_info, not stripped