compsec-snu / razzer

A Kernel fuzzer focusing on race bugs
358 stars 61 forks source link

Failed to build built-in.bc files #20

Closed Luluno01 closed 2 years ago

Luluno01 commented 2 years ago

Hi, I am following the instructions to build bitcode files. However, after running ./build-kernel.sh --config configs/static_analysis_v4.16.mk, for built-in.*, only built-in.o files were built but no built-in.bc. For other files, e.g., kernel/pid.c, the corresponding .o files and .bc files were built.

The ./build-kernel.sh scripts also failed because of a bunch undefined reference to xxx errors when executing the command tools/llvmlinux/arch/all/bin/llvm-link-bc.sh -m elf_x86_64 -z max-page-size=0x200000 --build-id -o .tmp_vmlinux1 -T ./arch/x86/kernel/vmlinux.lds --whole-archive built-in.o --no-whole-archive --start-group lib/lib.a arch/x86/lib/lib.a --end-group, according to tmp/log. As pointed out here, I can ignore the link error because it was expected, but I cannot find any built-in.bc files built for subsequent analysis.

Any ideas? Thanks!

lifeasageek commented 2 years ago

Hello,

It's been a while since we used llvm-linux (now we abandoned GCC and switched to the new LLVM/Clang version to build the kernel) as we also faced many technical issues similar to yours.

I'm unsure when we can release the newer version (which does not have such a hacky issue), but we will surely released the code once ready.

In the meantime, I suggest you may try with the new LLVM/Clang to build the kernel and static analysis.

Luluno01 commented 2 years ago

Thanks and good to hear that this problem will be solved! So does it mean as long as long I can manage to get the built-in.bc files, it does not matter how I get them?

lifeasageek commented 2 years ago

Right. The current problem is that the LLVM/Clang version that Razzer is built on cannot build the Linux kernel, so we went "a bit complex" llvm-linux. My guess is you will be fine as long as you get build-in.bc.

Luluno01 commented 2 years ago

Okay, I will give it a try. Thanks!