[LLVMdev] How to compile this linux-driver like programme into .bc file?

15102925731 zhenkaixd at 126.com
Mon Apr 16 04:42:46 PDT 2012


Thanks for your help and patience!

Best regards,
Zhen Kai
At 2012-04-16 15:35:25,"陳韋任" <chenwj at iis.sinica.edu.tw> wrote:
>> The thing is that I know the Makefile to complete that task. But what  I want to know the clang command that can do that. Since the makefile will generate a .ko file while I can use the clang command "-O3-emit-llvm" to generate a corresponding .bc file so the pass can be run on that.
>
>  I guess you can use something like (I am not SURE if Clang support those GCC
>flags entirely, try it yourself),
>
>$ clang -O2 -DMODULE -D__KERNEL__ YOUR_MODULE.c \
>  -W -Wall -Wstrict-prototypes -Wmissing-prototypes \
>  -isystem /lib/modules/`uname -r`/build/include \
>  -emit-llvm -o YOUR_MODULE.bc
>
>Regards,
>chenwj
>
>-- 
>Wei-Ren Chen (陳韋任)
>Computer Systems Lab, Institute of Information Science,
>Academia Sinica, Taiwan (R.O.C.)
>Tel:886-2-2788-3799 #1667
>Homepage: http://people.cs.nctu.edu.tw/~chenwj





More information about the llvm-dev mailing list