<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">I may try to use the Makefile then. <br><br>When using gcc<br>the Makefile is <br>CC := colorgcc<br>obj-m := hello.o<br>KERNELDIR := /lib/modules/2.6.36.1/build<br>PWD := $(shell pwd)<br>modules:<br>    $(MAKE) -C $(KERNELDIR) M=$(PWD) modules<br>#modules install:<br>#    $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install<br><br>How to change it so the generating result is .bc file not the .o file? PLEASE BE KIND AND HELP ME~~<br><br><div>--<br><div>
<div>
<div><font color="#c0c0c0" size="2">
<div><font color="#c0c0c0"><font size="3">  <span style="COLOR: #000000">          祝好!</span></font></font></div><span style="COLOR: #000000">
<div> </div>
<div><font size="3">  甄凯</font></div>
<div>
<div><font color="#c0c0c0"><font size="3">------------------------------------------------------------------------------------------------------</font></font></div></div>
<div><font color="#c0c0c0"><font size="3">2012-04-18</font></font></div></span></font></div>
<div><font color="#c0c0c0"><font size="3">------------------------------------------------------------------------------------------------------</font></font></div>
<div><font color="#c0c0c0"><font size="3">Name: 甄凯(ZhenKai)<br>Homepage:http://www.renren.com/262729393</font></font></div>
<div><font color="#c0c0c0"><font size="3">Email: </font><a href="mailto:zhenkaixd@126.com" target="_blank" _listener="1901"><font color="#0066cc" size="3">zhenkaixd@126.com</font></a><font size="3"> or <a href="mailto:846227103@qq.com">846227103@qq.com</a></font></font></div>
<div><font color="#c0c0c0" size="3">TEL: 15810729006(Beijing)<br>Address: Room I-406, Central Building, Tsinghua University, Beijing, China. 100084.</font></div></div></div></div><div id="divNeteaseMailCard"></div><br>At 2012-04-18 21:56:43,15102925731 <<a href="mailto:zhenkaixd@126.com">zhenkaixd@126.com</a>> wrote:<br> <blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Dear Chen,<br>I tried the command you told me. It turns out that clang use -I option rather then -isystem.<br>But after I included the init.h file, it fired at me that "asm/processor.h" is not fount. Then I included that file<br>using -I option and some other files were said not found! It's like I opened a can of worms...<br><br>I can still continue to include the file that is said not found. But is it the right way ?<br><br>Thank you!<br><br><pre>clang -O2 -DMODULE -D__KERNEL__ YOUR_MODULE.c \
>>  -W -Wall -Wstrict-prototypes -Wmissing-prototypes \
>>  -I /lib/modules/`uname -r`/build/include \
>>  -emit-llvm -o YOUR_MODULE.bc</pre><br><div>--<br><div>
<div>
<div><font color="#c0c0c0" size="2">
<div><font color="#c0c0c0"><font size="3">  <span style="COLOR: #000000">          祝好!</span></font></font></div><span style="COLOR: #000000">
<div> </div>
<div><font size="3">  甄凯</font></div>
<div>
<div><font color="#c0c0c0"><font size="3">------------------------------------------------------------------------------------------------------</font></font></div></div>
<div><font color="#c0c0c0"><font size="3">2012-04-18</font></font></div></span></font></div>
<div><font color="#c0c0c0"><font size="3">------------------------------------------------------------------------------------------------------</font></font></div>
<div><font color="#c0c0c0"><font size="3">Name: 甄凯(ZhenKai)<br>Homepage:http://www.renren.com/262729393</font></font></div>
<div><font color="#c0c0c0"><font size="3">Email: </font><a href="mailto:zhenkaixd@126.com" target="_blank" _listener="1901"><font color="#0066cc" size="3">zhenkaixd@126.com</font></a><font size="3"> or <a href="mailto:846227103@qq.com">846227103@qq.com</a></font></font></div>
<div><font color="#c0c0c0" size="3">TEL: 15810729006(Beijing)<br>Address: Room I-406, Central Building, Tsinghua University, Beijing, China. 100084.</font></div></div></div></div><div></div><br><pre><br>在 2012-04-16 19:42:46,15102925731 <<a href="mailto:zhenkaixd@126.com">zhenkaixd@126.com</a>> 写道:
>Thanks for your help and patience!
>
>Best regards,
>Zhen Kai
>At 2012-04-16 15:35:25,"陳韋任" <<a href="mailto:chenwj@iis.sinica.edu.tw">chenwj@iis.sinica.edu.tw</a>> 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
</pre></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span></blockquote></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>