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

陳韋任 chenwj at iis.sinica.edu.tw
Mon Apr 16 19:13:01 PDT 2012


> >$ 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

  You might need "-c" option so that Clang will not link the .bc file to
other libraries (.o file), just emit the final .bc file.

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