15102925731
2012-Apr-15 08:46 UTC
[LLVMdev] How to compile this linux-driver like programme into .bc file?
Hi all,I've been confuzed by this question for several days! I know there
is Started Guild in llvm.org to tell me how tocompile helloworld.c into ,bc
file. But what if it is a module that includes header files in linux?Could
you be kind and tell me the clang command that can compile the following
programme into a .bc file? Thank you! #include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
printk(KERN_ALERT "Hello, world\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world\n");
}
module_init(hello_init);
module_exit(hello_exit);
--
祝好!
甄凯
------------------------------------------------------------------------------------------------------
2012-04-15
------------------------------------------------------------------------------------------------------
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/20120415/23287ea7/attachment.html>
陳韋任
2012-Apr-15 10:12 UTC
[LLVMdev] How to compile this linux-driver like programme into .bc file?
Hi ZhenKai, Perhaps you can try to write a kernel module and compile it by using Clang first, (see http://www.faqs.org/docs/kernel/). You might be interested in this page, http://www.faqs.org/docs/kernel/x204.html which contains a Makefile used to compile a kernel module. Good Luck! 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
15102925731
2012-Apr-16 00:34 UTC
[LLVMdev] How to compile this linux-driver like programme into .bc file?
Thank you, Chen!
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.
Any help?
--
祝好!
甄凯
------------------------------------------------------------------------------------------------------
2012-04-16
------------------------------------------------------------------------------------------------------
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.
At 2012-04-15 18:12:24,"陳韋任" <chenwj at iis.sinica.edu.tw>
wrote:>Hi ZhenKai,
>
> Perhaps you can try to write a kernel module and compile it by using Clang
first,
>(see http://www.faqs.org/docs/kernel/). You might be interested in this
page,
>http://www.faqs.org/docs/kernel/x204.html which contains a Makefile used to
compile
>a kernel module. Good Luck!
>
>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
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20120416/e11bfdd9/attachment.html>
Maybe Matching Threads
- [LLVMdev] How to compile this linux-driver like programme into .bc file?
- [LLVMdev] How to compile this linux-driver like programme into .bc file?
- [LLVMdev] How to compile this linux-driver like programme into .bc file?
- [LLVMdev] How to compile this linux-driver like programme into .bc file?
- [LLVMdev] How to compile this linux-driver like programme into .bc file?