- build kernel using clang into binary successfully
- golang
- The related kernel module are enabled in Linux kernel configuration
go run path/of/v5.12/KernelBitcode.go --help- Build Kernel with clang
make LLVM=<Path_to_llvm> -j16Note
You can find out your llvm-* or clang in the Path_to_llvm
- Generate script to build kernel into LLVM Bitcode
go run path/of/v5.12/KernelBitcode.goImportant
If you do not use the llvm installed by the system but compile your own llvm version, you need to modify the specified parameters by viewing the -help parameter
- Get LLVM Bitcode
bash build.shbuilt-in.bc is in each directory.
All external modules are in the end of build.sh.
Now you can perform analysis on those LLVM bitcode files.