Hi, I am first year PhD student at Stony Brook University. For one of my projects I am trying to JIT compile and run a C program containing inline assembly using MCJIT but I am not able to. I have cloned and build LLVM-3.1. Below are more details. Arch : x86 OS : Linux ubuntu 2.6.35-22-generic Sample program : test_inline_asm.c ------------------- #include <stdio.h> int main(){ int a=0; __asm __volatile("movl $5,%%eax\t" "\n movl %%eax,%0":"=r"(a)::"cc","memory" ); printf("a= %d\n",a); } Commands ------------- clang -emit-llvm -S test_inline_asm.c lli -use-mcjit test_inline_asm.s throws, LLVM ERROR: Inline asm not supported by this streamer because we don't have an asm parser for this target Any pointers to what mistake I have been doing.Any help would be much appreciated. Thanks & Regards, Amit Arya -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121105/db27fbc5/attachment.html>
Hi Amit, You're not doing anything wrong. This is an error in 'lli' not properly initializing the native target libraries. Fixed in SVN trunk r167392. -Jim On Nov 4, 2012, at 4:09 PM, Amit Arya <aarya at cs.stonybrook.edu> wrote:> Hi, > > I am first year PhD student at Stony Brook University. For one of my projects I am trying to JIT compile and run a C program containing inline assembly using MCJIT but I am not able to. > > I have cloned and build LLVM-3.1. Below are more details. > > Arch : x86 > OS : Linux ubuntu 2.6.35-22-generic > > Sample program : test_inline_asm.c > ------------------- > #include <stdio.h> > int main(){ > int a=0; > __asm __volatile("movl $5,%%eax\t" > "\n movl %%eax,%0":"=r"(a)::"cc","memory" > ); > printf("a= %d\n",a); > } > > Commands > ------------- > clang -emit-llvm -S test_inline_asm.c > lli -use-mcjit test_inline_asm.s > > throws, > > LLVM ERROR: Inline asm not supported by this streamer because we don't have an asm parser for this target > > Any pointers to what mistake I have been doing.Any help would be much appreciated. > > Thanks & Regards, > Amit Arya > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121105/52c87a82/attachment.html>
Hi Jim, Thanks for the reply. I was able to figure out the problem in 'lli'. InitializeNativeTargetAsmParser() was missing in lli. I should have replied back saying that the problem was resolved. Hope I didn't waste your time. Regards, Amit ________________________________ From: Jim Grosbach [grosbach at apple.com] Sent: Monday, November 05, 2012 2:07 PM To: Amit Arya Cc: LLVM Developers Mailing List; Varinder Singh Subject: Re: [LLVMdev] Unable to Run Inline Asm with MCJIT Hi Amit, You're not doing anything wrong. This is an error in 'lli' not properly initializing the native target libraries. Fixed in SVN trunk r167392. -Jim On Nov 4, 2012, at 4:09 PM, Amit Arya <aarya at cs.stonybrook.edu<mailto:aarya at cs.stonybrook.edu>> wrote: Hi, I am first year PhD student at Stony Brook University. For one of my projects I am trying to JIT compile and run a C program containing inline assembly using MCJIT but I am not able to. I have cloned and build LLVM-3.1. Below are more details. Arch : x86 OS : Linux ubuntu 2.6.35-22-generic Sample program : test_inline_asm.c ------------------- #include <stdio.h> int main(){ int a=0; __asm __volatile("movl $5,%%eax\t" "\n movl %%eax,%0":"=r"(a)::"cc","memory" ); printf("a= %d\n",a); } Commands ------------- clang -emit-llvm -S test_inline_asm.c lli -use-mcjit test_inline_asm.s throws, LLVM ERROR: Inline asm not supported by this streamer because we don't have an asm parser for this target Any pointers to what mistake I have been doing.Any help would be much appreciated. Thanks & Regards, Amit Arya _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu<mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121105/9494b362/attachment.html>
Seemingly Similar Threads
- [LLVMdev] Unable to Run Inline Asm with MCJIT
- [LLVMdev] Unable to Run Inline Asm with MCJIT
- [LLVMdev] Building for a specific target, corei7
- [LLVMdev] Building for a specific target, corei7
- [LLVMdev] How to Check whether BasicBlock resides in a conditional branch