[LLVMdev] HELP: Clang options needed in command to compile device driver into linux module.

15102925731 zhenkaixd at 126.com
Wed Apr 11 20:42:39 PDT 2012


 Hello,

What option should be added in the clang command to compile linux device driver(from .c to .bc)?
Typically we need a makefile to compile a module. But I just want a simple command line.

I tried "clang -O3 -emit-llvm hello.c -c -o hello.bc " but  errors occurred saying
fatal error: 'linux/init.h' file not found
#include <linux/init.h>
         ^
1 error generated
Then I was taught to add -D or -I option so that clang can find the linux kernel head file. But I still dont know
how exactly the command like......All I want to know is a clang command line that can compile a helloworldmodule.c into helloworldmodule.bc.

Please give me some suggestion.
Any help would be appreciated!


--

            祝好!
 
  甄凯
------------------------------------------------------------------------------------------------------
2012-04-12
------------------------------------------------------------------------------------------------------
Name: 甄凯(ZhenKai)
Homepage:http://www.renren.com/262729393
Email: zhenkaixd at 126.com or 846227103 at qq.com
TEL: 15810729006(Beijing)
Address: Room I-406, Central Building, Tsinghua University, Beijing, China. 100084.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120412/7d2f41c9/attachment.html>


More information about the llvm-dev mailing list