ucsb-seclab / dr_checker

DR.CHECKER : A Soundy Vulnerability Detection Tool for Linux Kernel Drivers
BSD 2-Clause "Simplified" License
329 stars 71 forks source link

How to compile driver using clang #28

Open ghost opened 5 years ago

ghost commented 5 years ago

Hi, I encountered a difficulty about how to compile driver using clang and I find your tool can make it so I need your help.

For example, I want to compile the bluetooth module of the drivers in the linux kernel 4.19.9. I substitute the gcc by clang in the Makefile. But there were some mistakes and it says "You are building kernel with non-retpoline compiler, please update your compiler." .

So, if you intend to compile the bluetooth module, what will you do? Could you explain it?

Thanks.

Machiry commented 5 years ago

Is it for x86_64?

ghost commented 5 years ago

Is it for x86_64?

Yes. I find that the issue is that clang cannot pass the check before beginning compiling the kernel. Now I find a walk-around to bypass the check, but when I'm compiling, the clang compiler complains about asm

./arch/x86/include/asm/atomic.h:200:1559: error: invalid output constraint
      '=@ccz' in asm
  ...%[ptr]" "\n\t/* output condition code " "z" "*/\n" : "=@cc" "z" (success...